Re: NSURLConnection doesn't post
Re: NSURLConnection doesn't post
- Subject: Re: NSURLConnection doesn't post
- From: "Tom Harrington" <email@hidden>
- Date: Fri, 11 Apr 2008 11:14:38 -0600
On Fri, Apr 11, 2008 at 3:53 AM, Micha Fuhrmann <email@hidden> wrote:
> Ok, I've used - (void)performSelectorOnMainThread:(SEL)aSelector
> withObject:(id)arg waitUntilDone:(BOOL)wait and it's fine one, you've
> pointed t what was wrong, however I thought that because the method sendLogs
> was invoqued by an instance that is alive during the whole app lifetime it
> would be OK. Turns out that NSURLConnections called indirectly by a short
> time run loop to the main thread doesn't follow up.
Right, the run loop needs to keep going at least until NSURLConnection
is finished. Although secondary threads don't automatically get run
loops, it's OK to create new run loops in different threads if it's
appropriate to your situation. Using -performSelectorOnMainThread: is
one way around the problem, but it might make more sense to just give
the thread its own run loop. It all depends on your app architecture.
--
Tom Harrington
email@hidden
AIM: atomicbird1
_______________________________________________
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