Skip navigation.
 
mlRe: performSelectorOnMainThread problem
FROM : Thomas Engelmeier
DATE : Thu Mar 13 10:16:13 2008

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 ':'.

Related mailsAuthorDate
mlperformSelectorOnMainThread problem Nick Rogers Mar 13, 02:27
mlRe: performSelectorOnMainThread problem John Stiles Mar 13, 02:30
mlRe: performSelectorOnMainThread problem Nick Rogers Mar 13, 02:32
mlRe: performSelectorOnMainThread problem John Stiles Mar 13, 02:44
mlRe: performSelectorOnMainThread problem Nick Rogers Mar 13, 03:00
mlRe: performSelectorOnMainThread problem Dave Hersey Mar 13, 03:03
mlRe: performSelectorOnMainThread problem Thomas Engelmeier Mar 13, 10:16