Re: performSelectorOnMainThread fails second time through
Re: performSelectorOnMainThread fails second time through
- Subject: Re: performSelectorOnMainThread fails second time through
- From: Dave Keck <email@hidden>
- Date: Wed, 8 Dec 2010 07:02:22 -0500
> FYI, I do not create any run loops explicitly in my application
That's good, because run loops can't be created explicitly. :)
> and can't think of anything I am doing which would create one implicitly.
A run loop is automatically created for every thread that's spawned.
(I believe this happens lazily though.)
So to summarize, it appears that the instance of NSThread representing
the main thread has the wrong instance of CFRunLoop. Some thoughts:
1. Are you using the pthread APIs directly in your code? I recall
there are several places in the docs that mention certain
considerations that have to be made to use the pthread and
Cocoa/NSThread APIs safely together.
2. Do you have any functions marked __attribute__ ((constructor)) ?
3. What does your main() function look like?
4. Does -performSelectorOnMainThread work if you call [NSThread
mainThread] as the first line in main()?
_______________________________________________
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