Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

CPURLConnection starting

#7

The documentation currently states that CPURLConnection +(CPURLConnection)connectionWithRequest:(CPURLRequest)aRequest delegate:(id)aDelegate

returns a "a connection that can be started to initiate the request"

but actually the connection seems to be started by this method automatically, no need to call start.

(Actually calling start seems to cause problems in Camino)

Reported by Angus Hardie · September 4th, 2008 @ 05:27 PM

State: resolved
Milestone: 0.5.1
Assigned to: nobody

Activity

  1. Francisco Tolmasky
    Francisco Tolmasky

    You are correct, we will fix that in the docs.

    September 4th, 2008 @ 07:00 PM

  2. Karl Adam
    Karl Adam

    I'm confused, do you mean you'll add docs that say it starts from -connectionWithRequest:delegate: or -start ?

    I'd like to suggest that it require the -start call to kick off the connection, besides it being the behavior of NSURLConnection, it also maintains the behavior better that you've created an object, can configure your objects appropriately for the expected data then start the url connection.

    September 7th, 2008 @ 08:39 PM

  3. Ross Boucher
    Ross Boucher
    • State changed from new to open

    Karl, when you create a connection like this:

    
    var connection = [[CPURLConnection alloc] initWithRequest:aRequest delegate:aDelegate startImmediately:NO]
    

    It will not fire immediately, so you can modify it as you please. These init methods were accidentally left out of the documentation. We'll add them back in with the next update.

    The class method +connectionWithRequest does fire immediately. Personally, I prefer this behavior. Is having the init enough?

    September 8th, 2008 @ 08:41 PM

  4. Karl Adam
    Karl Adam

    yes, this is fine since it matches what the NSURLConnection APIs do which is how I became confused by this bug. thanks for the heads up.

    September 8th, 2008 @ 09:08 PM

  5. Ross Boucher
    Ross Boucher
    • State changed from open to resolved

    The docs have been updated in the inline codebase, and will be updated on the site sometime tonight.

    September 10th, 2008 @ 06:31 PM

  6. Francisco Tolmasky

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.