RE: literal strings - who do they belong to?
RE: literal strings - who do they belong to?
- Subject: RE: literal strings - who do they belong to?
- From: Jeff Laing <email@hidden>
- Date: Mon, 13 Jul 2009 00:10:55 +0000
- Acceptlanguage: en-US
- Thread-topic: literal strings - who do they belong to?
> According to Cocoa/ObjC memory-management, if you get an object
> (reference) via "alloc","new",any object that contains "copy", and
> any object you send [<object> retain] to, is yours - it becomes your
> responsibility to call [<your object> release] on it when you're
> done. Ditto for properties like
>
> @property (nonatomic,retain) <data type>myProp;
>
> where "retain" is specified.
>
> But what about literal NSStrings?
Did you get it via alloc, new or copyXXX ?
No?
No need to release it then!
No new rule to remember, no special case to worry about.
_______________________________________________
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