On Mon, Oct 20, 2008 at 3:25 AM, Ron Green <[EMAIL PROTECTED]> wrote:
> stringWithFormat: returns an NSString that is autoreleased. I know this
> because I read it in Hillegasses book. But since this does not seem to be
> covered in the documentation, if I had not read it in a book, how would I
> discover that the NSString was autoreleased?

Actually, the documentation usually isn't explicit about whether an
object is autoreleased.  The Cocoa Memory Management documentation
specifies the rules you must follow (if you create something, release
it; if you don't create it, you must retain it if you want to hold
onto it, and you must release it later), but that doesn't mean that a
method will necessarily return an autoreleased object.  In most cases,
it will, but it may return a singleton, for example.  Or some crazy
self-memory-managing thing.

Just follow the rules and you'll be fine.

--Kyle Sluder
_______________________________________________

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 [EMAIL PROTECTED]

Reply via email to