Re: Which class methods return autoreleased objects?
Re: Which class methods return autoreleased objects?
- Subject: Re: Which class methods return autoreleased objects?
- From: Scott Anguish <email@hidden>
- Date: Tue, 7 Dec 2004 00:30:02 -0500
On Dec 6, 2004, at 4:36 PM, Jeremy French wrote:
Where in the documentation do you find out, whether or not a class
method returns an autoreleased object?
For example, NSString has the method "stringWithFormat:", which
returns an autoreleased NSString object. But when I look at the
documentation, there is no mention that the object is being returned
autoreleased.
The reference I used is "Foundation Reference for Objective-C",
locating the "stringWithFormat:" under NSString. The documentation
simply reads, "Returns a string created in the manner of
localizedStringWithFormat:, but using the user’s default locale to
format numbers. See 'Using Format Strings' for more information." (See
<http://developer.apple.com/documentation/Cocoa/Reference/Foundation/
ObjC_classic/Classes/NSString.html#//apple_ref/doc/uid/20000154/
stringWithFormat_>)
So how do you determine when a class method returns an autoreleased
object?
The "Introduction to Memory Management" document covers the Rules.
http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/
index.html
The exceptions (and they're very, very rare) are called out in the
Reference documents for the methods.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden