In short yes. The long answer is the textfield will release the string when it's done with it and if no one else retained the string it will be deallocated.

On Jun 14, 2008, at 9:35 PM, Christopher J Kemsley wrote:

I'm new to Obj-C, and I'm trying to make sure I start off writing good code so I don't have to come back and learn how to avoid dirty code and/or memory leaks.

That being said, if I do the following:


NSString *someString = [ NSString stringWithString:@"Hello World!" ] ;
[ someNSTextField setStringValue:someString ] ;


Does the NSTextField take care of de-allocating the memory from the old value by itself?

_______________________________________________

Cocoa-dev mailing list ([email protected])

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