Re: performSelectorOnMainThread problem
Re: performSelectorOnMainThread problem
- Subject: Re: performSelectorOnMainThread problem
- From: Dave Hersey <email@hidden>
- Date: Wed, 12 Mar 2008 22:03:29 -0400
You definitely should specify the colon, but I suspect this points to
a bigger problem:
I have imported the main AppController.h into this secondary class
file.
The "secondary class" part makes me wonder. Is this method actually
defined in the object where you're calling
performSelectorOnMainThreadFrom? That's what you're saying by passing
self.
If not, you need to refer to the class/object it's in. So, if
"updateProgress:" is defined in your app controller and you have a
reference to that, you might do something like:
[m_appController
performSelectorOnMainThread:@selector(updateProgress:) withObject:data
waitUntilDone:YES];
If you don't have a reference to the app controller, you can use
(AppController *) [NSApp delegate] for the first parameter, if the app
delegate is also your app controller.
In any case, the first parameter should be an object that responds to
the selector you're passing. Either that's not the case, or the
selector you're passing is incorrect.
- d
On Mar 12, 2008, at 9:32 PM, Nick Rogers wrote:
Yes I was using updateProgress with the colon earlier, but still
didn't worked.
Wishes,
Nick
On 13-Mar-08, at 7:00 AM, John Stiles wrote:
If -updateProgress is taking "data" as an argument, then you
probably want
@selector(updateProgress:)
Note the colon.
Nick Rogers wrote:
Hi,
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.
Regards,
Nick
_______________________________________________
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