• 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: Jeff LaMarche <email@hidden>
  • Date: Sun, 28 Oct 2001 20:26:30 -0800

On Sunday, October 28, 2001, at 04:30 PM, Scott Anguish wrote:

At 2:14 PM -0800 10/28/01, Steven W. Riggins wrote:
imageData = [NSData dataWithContentsOfURL:imageURL];
[imageData retain];
image = [[NSImage alloc] initWithData:imageData];


[SNIP]
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.


I probably should have clarified here that I retain the NSData object for other purposes and take care of cleaning it up in my dealloc object. By keeping around a reference to the original data, it makes it a lot easier to save the image to a file, etc.

I probably should have deleted the line of code when I pasted it into my e-mail, or clarified that it wasn't necessary in most instances where you would do that.


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

  • Prev by Date: Lookup in pbs of server "services" failed. Why do you think that is?
  • Next by Date: .Nib won't open
  • Previous by thread: Re: NSURL Tutorial?
  • Next by thread: Re: NSURL Tutorial?
  • Index(es):
    • Date
    • Thread