On 3 Apr '08, at 5:50 PM, Adam Leonard wrote:
If you are writing a tool that links with Foundation and not AppKit, an autorelease pool is NOT created for you. As you saw in your first example, you need to explicitly create and destroy one whenever you are dealing with Foundation objects in a method.
It depends. At the outermost scope, like the main() method and things called directly by it, you have to create your own pools. But if your process uses NSRunLoop, that class ensures that everything it calls is in the context of an autorelease pool. So you don't have to worry about this when writing delegate/target methods for NSTimers, NSURLConnections, etc.
Of course, it doesn't hurt to add your own anyway, if you want; it's just a very small performance overhead.
—Jens
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ 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]