Fwd: NSURLConnection retainCount at initialisation

  • and BTW, there is something else i don't really get !
    if the NSMutableURLRequest is deeply-copied (as specified in the doc),
    then why does my app crashes when the request is autoreleased ?

    in the doc :
    http://developer.apple.com/documentation/Cocoa/Conceptual/
    URLLoadingSystem/index.html#//apple_ref/doc/uid/10000165i

    Note: When a client application initiates a connection or download
    using an instance of NSMutableURLRequest, a deep copy is made of the
    request. Changes made to the initiating request have no effect once a
    download has been initialized.

    Begin forwarded message:

    > From: Julien Palmas <julien.palmas...>
    > Date: 19 June 2004 9:52:02 PM
    > To: Dev Cocoa <cocoa-dev...>
    > Subject: NSURLConnection retainCount at initialisation
    >
    > hi list
    >
    > why do i get a retainCount of 2 when i create a NSURLConnection with
    > the following code ?
    >
    > myURL = [NSURL URLWithString:@"http://www.apple.com"];
    > myRequest = [NSMutableURLRequest requestWithURL:myURL];
    > myConnection = [NSURLConnection connectionWithRequest:myRequest
    > delegate:self];
    >
    > myRequest retainCount = 1 (1 for creation, nothing for myConnection as
    > the NSURLRequest is deeply-copied by NSURLConnection)
    > myConnection retainCount = 2 (1 for creation, the otherone i don't
    > know) !!!
    > myURL retainCount = 4 (1 for creation, 1 for myRequest and 2 for
    > myConnection)
    > _______________________________________________
    > cocoa-dev mailing list | <cocoa-dev...>
    > Help/Unsubscribe/Archives:
    > http://www.lists.apple.com/mailman/listinfo/cocoa-dev
    > Do not post admin requests to the list. They will be ignored.
    _______________________________________________
    cocoa-dev mailing list | <cocoa-dev...>
    Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
    Do not post admin requests to the list. They will be ignored.
previous month june 2004 next month
MTWTFSS
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30        
Go to today
MindNode
MindNode offered a free license !