• 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: Guidance for learner
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Guidance for learner


  • Subject: Re: Guidance for learner
  • From: Brian Smith <email@hidden>
  • Date: Tue, 26 Jun 2007 15:50:57 -0600

I believe this,

On Jun 26, 2007, at 4:57 AM, Alan Smith wrote:
NSData *data = [[NSData alloc] initWithContentsOfFile: filePath];

[files addObject: data];

will retain the NSData object twice so it should be,

NSData *data =  [NSData dataWithContentsOfFile: filePath];

[files addObject: data];

so you get an autoreleased NSData objects which would be released properly when the files array is released.

Brian
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Guidance for learner
      • From: "Alan Smith" <email@hidden>
References: 
 >Guidance for learner (From: "Barry" <email@hidden>)
 >Re: Guidance for learner (From: "Alan Smith" <email@hidden>)

  • Prev by Date: Re: Play a song with QTMovie
  • Next by Date: Re: Core Data / Bindings question
  • Previous by thread: Re: Guidance for learner
  • Next by thread: Re: Guidance for learner
  • Index(es):
    • Date
    • Thread