• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Why does -[NSURLConnection start] crash?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why does -[NSURLConnection start] crash?


  • Subject: Re: Why does -[NSURLConnection start] crash?
  • From: Peter N Lewis <email@hidden>
  • Date: Tue, 31 Mar 2009 11:06:48 +0800

On 31/03/2009, at 3:32 , Jeff Johnson wrote:
Here's the sample code:

http://lapcatsoftware.com/downloads/ConnectionStartCrash.m

It crashes when calling this:

_connection = [[NSURLConnection alloc] initWithRequest:request delegate:self startImmediately:NO];
[_connection start];

Google for NSURLConnection startImmediately

Second link:

<http://veys.com/2008/08/17/nsurlconnection-startimmediatelyno-boom/>
Apparently when not using the simpler initWithRequest:delegate:, or even startImmediately:YES, the connection does not get scheduled in the current run loop. And again apparently, this causes unhappiness to occur when you eventually get around to calling start.

Simple fix, just stuff it in the current run loop before calling start and everyone gets along just fine.

[c scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];


Enjoy, Peter.

--
     Run macros from your iPhone with Keyboard Maestro Control!
         or take a break with Derzle for your iPhone

Keyboard Maestro <http://www.keyboardmaestro.com/> Macros for your Mac
Aragom Space War <http://www.stairways.com/iphone/aragom> Don't get killed!
Derzle <http://www.stairways.com/iphone/derzle> Enjoy a relaxing puzzle.
<http://www.stairways.com/> <http://download.stairways.com/>





_______________________________________________

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


References: 
 >Why does -[NSURLConnection start] crash? (From: Jeff Johnson <email@hidden>)

  • Prev by Date: Re: How can I draw an election map?
  • Next by Date: Re: EXC_BAD_ACCESS and NSAttributedString driving me crazy
  • Previous by thread: Why does -[NSURLConnection start] crash?
  • Next by thread: opening a file
  • Index(es):
    • Date
    • Thread