• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSTextField "setStringValue" method - deallocates?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTextField "setStringValue" method - deallocates?


  • Subject: Re: NSTextField "setStringValue" method - deallocates?
  • From: Michael Vannorsdel <email@hidden>
  • Date: Sat, 14 Jun 2008 21:44:22 -0600

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@hidden)

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:
This email sent to email@hidden


References: 
 >NSTextField "setStringValue" method - deallocates? (From: Christopher J Kemsley <email@hidden>)

  • Prev by Date: NSTextField "setStringValue" method - deallocates?
  • Next by Date: Re: NSURLCache - how?
  • Previous by thread: NSTextField "setStringValue" method - deallocates?
  • Next by thread: Re: NSTextField "setStringValue" method - deallocates?
  • Index(es):
    • Date
    • Thread