• 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: 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.


  • Follow-Ups:
    • Re: NSURL Tutorial?
      • From: Jeff LaMarche <email@hidden>
    • Re: NSURL Tutorial?
      • From: "Steven W. Riggins" <email@hidden>
References: 
 >Re: NSURL Tutorial? (From: "Steven W. Riggins" <email@hidden>)

  • Prev by Date: Putting stuff into a tab view programmatically
  • Next by Date: Re: NSURL Tutorial?
  • Previous by thread: Re: NSURL Tutorial?
  • Next by thread: Re: NSURL Tutorial?
  • Index(es):
    • Date
    • Thread