Re: NSUrl: Which method to use
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