• 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
Re: NSURL Tutorial?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSURL Tutorial?


  • Subject: Re: NSURL Tutorial?
  • From: "Steven W. Riggins" <email@hidden>
  • Date: Sun, 28 Oct 2001 16:34:29 -0800

At 7:30 PM -0500 10/28/01, Scott Anguish wrote:
>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.

Right. Is this a bug as well? I sure wish Apple's doc dept would not assume we know how classes work and explictly state "initWithData retains the image data"

I prefer explicit definition over implied general function. :)


steve


  • Follow-Ups:
    • Re: NSURL Tutorial?
      • From: Scott Anguish <email@hidden>
References: 
 >Re: NSURL Tutorial? (From: Scott Anguish <email@hidden>)

  • Prev by Date: Re: NSURL Tutorial?
  • Next by Date: Re: NSURL Tutorial?
  • Previous by thread: Re: NSURL Tutorial?
  • Next by thread: Re: NSURL Tutorial?
  • Index(es):
    • Date
    • Thread