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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/cocoadev%40mikeabdullah.net

This email sent to cocoa...@mikeabdullah.net

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to