Thanks, Dave. The first link does seem to have a workaround for the crash. (Not sure the second link is the same problem, though.)

Bug filed:

rdar://problem/6747757

The question is whether this is a framework bug or just a documentation bug. Can anyone from Apple please clarify this?

-Jeff


On Mar 30, 2009, at 4:29 PM, Dave Keck wrote:

I had this problem several months ago, and found several other
references to the issue:

http://veys.com/2008/08/17/nsurlconnection-startimmediatelyno-boom/
http://amromousa.com/2008/08/27/nsurlconnection-timeoutconnection-amdev-woes/

I suppose a bug report is in order...

On Mon, Mar 30, 2009 at 9:32 AM, Jeff Johnson
<publicpost...@lapcatsoftware.com> 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];

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?

-Jeff

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to