• 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: literal strings - who do they belong to?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >literal strings - who do they belong to? (From: William Squires <email@hidden>)

  • Prev by Date: Re: Best 'Cocoa' File Preview
  • Next by Date: Re: Capturing active state
  • Previous by thread: Re: literal strings - who do they belong to?
  • Next by thread: Printing a View
  • Index(es):
    • Date
    • Thread