• 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 problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: performSelectorOnMainThread problem


  • Subject: Re: performSelectorOnMainThread problem
  • From: Thomas Engelmeier <email@hidden>
  • Date: Thu, 13 Mar 2008 10:16:13 +0100


On 13.03.2008, at 02:27, Nick Rogers wrote:

In my secondary thread I'm doing:
[self performSelectorOnMainThread:@selector(updateProgress) withObject:data waitUntilDone:YES];


with the error that self does not recognize the selector updateProgress.
I have imported the main AppController.h into this secondary class file. still the problem.

You have two errors here:
- regardless which object implements the method, you need to send the message _to that object_ and not to self.
Importing some header is not the magic bullet, Objective-C can not guess which object might want to handle the message.


- the signature in @selector() is for sure wrong when you supply an argument in "withData:";. It lacks the trailing ':'.

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >performSelectorOnMainThread problem (From: Nick Rogers <email@hidden>)

  • Prev by Date: Re: How to make a UI like in Mail?
  • Next by Date: NSSpeechSynthesizer/UKSpeechSynthesizer speechSynthesizer:didFinishSpeaking: called immediarely
  • Previous by thread: Re: performSelectorOnMainThread problem
  • Next by thread: Core Data - Cascading Not Working?
  • Index(es):
    • Date
    • Thread