• 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: Releasing NSSearchPathForDirectoriesInDomain causes crash
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Releasing NSSearchPathForDirectoriesInDomain causes crash


  • Subject: Re: Releasing NSSearchPathForDirectoriesInDomain causes crash
  • From: Anthony Smith <email@hidden>
  • Date: Wed, 30 Sep 2009 22:21:13 -0400

Awesome! Thanks!

On Sep 30, 2009, at 10:18 PM, Graham Cox wrote:

Yes, because it's not yours to release.

RTFMMGA:	http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmObjectOwnership.html#//apple_ref/doc/uid/20000043-BEHDEDDB


--Graham



On 01/10/2009, at 12:07 PM, Anthony Smith wrote:

Does anybody know why releasing the NSArray obtained from NSSearchPathForDirectoriesInDomain causes my iPhone app to crash? Here's my code:

+ (NSString *)dataFilePath:(NSString *)filename {
NSArray *paths = NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, YES);
NSString *directory = [paths objectAtIndex:0];

[paths release];

return [directory stringByAppendingPathComponent:filename];


Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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

References: 
 >Releasing NSSearchPathForDirectoriesInDomain causes crash (From: Anthony Smith <email@hidden>)
 >Re: Releasing NSSearchPathForDirectoriesInDomain causes crash (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: NSWindowController and GC
  • Next by Date: Re: Releasing NSSearchPathForDirectoriesInDomain causes crash
  • Previous by thread: Re: Releasing NSSearchPathForDirectoriesInDomain causes crash
  • Next by thread: Re: Releasing NSSearchPathForDirectoriesInDomain causes crash
  • Index(es):
    • Date
    • Thread