Re: RunLoops and performSelectorOnMainThread problem
Re: RunLoops and performSelectorOnMainThread problem
- Subject: Re: RunLoops and performSelectorOnMainThread problem
- From: Michael Ash <email@hidden>
- Date: Wed, 6 May 2009 11:34:33 -0400
On Wed, May 6, 2009 at 3:13 AM, Martin F. Carianni
<email@hidden> wrote:
> Hello, i'm having some trouble with CFRunLoop, and
> performSelectorOnMainThread. I've a CFFTP client (with a latter COCOA
> implementation to interface with the GUI-class) which needs to pass a
> directory listing array to the GUI. But when I try to send the array object
> via an external selector (on a NSView class) it will ignore my
> performSelectorOnMainThread when called from the end of the directory
> listing callback. I don't know why, but it will call the internal "to self"
> methods but completely ignores the "self.delegate" ones. I cannot
> communicate with my GUI and this is very frustrating.
The most common reason for a message being "ignored" is because the
receiver is nil. Step through your code in the debugger and see if
self.delegate really is what you think it should be.
By the way, it's a bad idea to have multiple calls to
performSelectorOnMainThread: in a row like this. It's inefficient and
gives you a large opportunity for brokenness by having other actions
insert themselves in between the main-thread-perform actions. Instead,
use performSelectorOnMainThread: only once, to call out to another
method of yours which then performs all of the necessary main thread
actions together.
Mike
_______________________________________________
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