• 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
Fwd: NSURLConnection retainCount at initialisation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fwd: NSURLConnection retainCount at initialisation


  • Subject: Fwd: NSURLConnection retainCount at initialisation
  • From: Julien Palmas <email@hidden>
  • Date: Sat, 19 Jun 2004 22:15:31 +0200

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 <email@hidden>
> Date: 19 June 2004 9:52:02 PM
> To: Dev Cocoa <email@hidden>
> 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 | email@hidden
> 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 | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Prev by Date: Re: iChat plug-ins?
  • Next by Date: Bindings
  • Previous by thread: No notification when app crashes?
  • Next by thread: Re: NSURLConnection retainCount at initialisation
  • Index(es):
    • Date
    • Thread