• 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: Which method to use
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSUrl: Which method to use


  • Subject: Re: NSUrl: Which method to use
  • From: Mike Abdullah <email@hidden>
  • Date: Sat, 27 Jun 2009 14:12:04 +0100

No. Read the memory management guide.

On 27 Jun 2009, at 13:24, M.S. Hrishikesh wrote:

To create an NSUrl from a file which would be the preferred way

NSString *myFile = @"myFile.xml";

Method A:
NSUrl *myUrl = [NSUrl fileURLWithPath:myFile]

Method B:
NSUrl *myURL = [[NSUrl alloc] initFileURLWithPath:myFile];

Using method B I would need to release my object at some point (this is for iPhone so no GC). Using Method A means no need to release. But with MethodA the object is probably gone as soon as I exit the method correct?

Thanks
Hrishi
_______________________________________________

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

_______________________________________________

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: 
 >NSUrl: Which method to use (From: "M.S. Hrishikesh" <email@hidden>)

  • Prev by Date: Re: Detecting that a process has ended?
  • Next by Date: Re: NSUrl: Which method to use
  • Previous by thread: NSUrl: Which method to use
  • Next by thread: Re: NSUrl: Which method to use
  • Index(es):
    • Date
    • Thread