Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6101111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:27:47+00:00 2026-05-23T13:27:47+00:00

How can i call one method from a NSThread? i can call one method

  • 0

How can i call one method from a NSThread?

i can call one method like below:

[regionsMapView addAnnotation:addAnnotation];

How can i call that in a NSThread?
I have used like below:

[NSThread detachNewThreadSelector:@selector(addAnnotation) 
                         toTarget:regionsMapView 
                       withObject:addAnnotation];

But application crashes with log like below:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSThread initWithTarget:selector:object:]: target does not implement selector (*** -[MKMapView addAnnotation])'
*** Call stack at first throw:
(
    0   CoreFoundation                      0x0182b5a9 __exceptionPreprocess + 185
    1   libobjc.A.dylib                     0x0197f313 objc_exception_throw + 44
    2   CoreFoundation                      0x017e3ef8 +[NSException raise:format:arguments:] + 136
    3   CoreFoundation                      0x017e3e6a +[NSException raise:format:] + 58
    4   Foundation                          0x0006c392 -[NSThread initWithTarget:selector:object:] + 146
    5   Foundation                          0x0006c2d3 +[NSThread detachNewThreadSelector:toTarget:withObject:] + 98
    6   MJA                                 0x00008a8e -[TaetPaViewController showAddress:withItem:] + 389
    7   MJA                                 0x00008eb9 -[TaetPaViewController UpdateInfo] + 784
    8   MJA                                 0x0000835a -[TaetPaViewController parseTheLocalXml] + 408
    9   Foundation                          0x0006ccf4 -[NSThread main] + 81
    10  Foundation                          0x0006cc80 __NSThread__main__ + 1387
    11  libSystem.B.dylib                   0x911a47fd _pthread_start + 345
    12  libSystem.B.dylib                   0x911a4682 thread_start + 34
)
terminate called after throwing an instance of 'NSException'
Program received signal:  “SIGABRT”.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T13:27:47+00:00Added an answer on May 23, 2026 at 1:27 pm

    You forgot the colon at the end.

    @selector(addAnnotation)
    

    is not

    @selector(addAnnotation:)
    

    The first calls a method that takes no parameters and the second takes one parameter.
    Your code should be this

    [NSThread detachNewThreadSelector:@selector(addAnnotation:) 
                         toTarget:regionsMapView 
                       withObject:addAnnotation];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can I call public method from within private one: var myObject = function() {
How is it that tools like this one can make an ajax style call
This was the question asked in interview. Can we call one constructor from another
I want to call this procedure that sends one value that can be NULL
I have a function that wraps a call to one of my socket types.
I know that calling a virtual method from a base class constructor can be
I know that you can call functions using variable names like this: $foo =
I have a recursive method call. When any exception is thrown, I would like
I have web application where i want to call one method on body onload
I have a question regarding calling a method from one activity in a different

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.