• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: performSelectorOnMainThread
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: performSelectorOnMainThread


  • Subject: Re: performSelectorOnMainThread
  • From: James Bucanek <email@hidden>
  • Date: Thu, 20 Jul 2006 07:43:57 -0700

Eric Blanpied wrote on Thursday, July 20, 2006:

>I'm trying to use (void)performSelectorOnMainThread:(SEL)aSelector
>withObject:(id)arg waitUntilDone:(BOOL)wait, and I don't understand
>how to receive the argument.
>
> From the docs: "The method should not have a significant return
>value and should take a single argument of type id, or no arguments."
>
>I can make it work when my method has no arguments, but I want to
>pass a dictionary with some data. When I add (id)arg or (id*)arg, I
>get an exception with "selector not recognized".
>
>What's the proper way to do this, and how would I retrieve the dict
>once I got it? Would I cast the object as an NSDictionary?

You're probably running into the subtleties of Cocoa message naming. This one trips me up at least once a week:

    @selector(myMethod) is the selector for - (void)myMethod;

    @selector(myMethod:) is the selector for - (void)myMethod:(id)param;

Note the colon. It's important.

--
James Bucanek
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: performSelectorOnMainThread
      • From: Eric Blanpied <email@hidden>
    • Re: performSelectorOnMainThread
      • From: "Sean McBride" <email@hidden>
References: 
 >performSelectorOnMainThread (From: Eric Blanpied <email@hidden>)

  • Prev by Date: Re: performSelectorOnMainThread
  • Next by Date: Error with core data fetch requests: subentitiesByName misapplied, and segfaults
  • Previous by thread: Re: performSelectorOnMainThread
  • Next by thread: Re: performSelectorOnMainThread
  • Index(es):
    • Date
    • Thread