Re: NSURL Tutorial?
Re: NSURL Tutorial?
- Subject: Re: NSURL Tutorial?
- From: Scott Anguish <email@hidden>
- Date: Sun, 28 Oct 2001 19:30:02 -0500
On Sunday, October 28, 2001, at 07:09 PM, Steven W. Riggins wrote:
At 2:14 PM -0800 10/28/01, Steven W. Riggins wrote:
imageData = [NSData dataWithContentsOfURL:imageURL];
[imageData retain];
image = [[NSImage alloc] initWithData:imageData];
}
Actually it looks like your way (telling the data to get the data, not
the NSURL] does not leak.
I guess this leak still exists (see Andrew's email to me) when the URL
is an HTTP url (and not file for example)
Well, give the above, I think that you're probably dealing with the
imageData being retained when it doesn't need to be as well. NSImage
initWithData doesn't appear to require that the data be retained when it
is passed to it.