Why does -[NSURLConnection start] crash?

Here's the sample code:


It crashes when calling this:

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

but not this:

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

Of course, you wouldn't normally want to call [_connection start] immediately; in my tool, I was using performSelector:afterDelay: to call it, and the crash still occurs.

Here's the backtrace:

#0 0x97092152 in CFSetApplyFunction ()
#1 0x95b0cdad in CFNSchedulingSetScheduleSource ()
#2 0x95b375bb in RunLoopMultiplexer::sourceForScheduling ()
#3 0x95b3769a in RunLoopMultiplexer::schedule ()
#4 0x95b88d96 in URLConnectionClient::start ()
#5 0x00001bd9 in -[MyConnectionDelegate connectWithCrash:] (self=0x103330, _cmd=0x1f5c, shouldCrash=1 '\001') at /Users/jeff/ Documents/Programming/TestProjects/ConnectionStartCrash/ ConnectionStartCrash.m:24
#6 0x00001d38 in main (argc=1, argv=0xbffff694) at /Users/jeff/ Documents/Programming/TestProjects/ConnectionStartCrash/ ConnectionStartCrash.m:50

The argument for cachePolicy: doesn't seem to matter, by the way.

Am I missing something? Is there some run loop setup I need to perform?



Cocoa-dev mailing list (Cocoa-dev@xxxxxxxxxxxxxxx)

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 mailli...