On 24 Mar '08, at 9:19 PM, Samvel wrote:

Should I retain string in init?

Yes. When you store an object pointer in an instance variable you almost always want to retain it, so the object pointed to won't get deleted. If the pointer came from an "init" method, that object is already retained and you can just assign it to the instance variable. But if you got it through any other source, including a class factory method like +[NSString stringWith....], then the object has _not_ been retained for you, and if you want to keep a reference you'll need to call -retain yourself.

…Or you could just enable garbage collection and not have to deal with all this crap. It just means your app will require 10.5 or later.

—Jens

Attachment: 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]

Reply via email to