• 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: newbie memory question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: newbie memory question


  • Subject: Re: newbie memory question
  • From: Scott Stevenson <email@hidden>
  • Date: Mon, 15 Nov 2004 20:48:57 -0800


On Nov 15, 2004, at 6:46 PM, Daniel Child wrote:

I wrote a simple app to count the letters in a textfield. In the code below, I checked for retain counts. A couple of people have suggested I use accessor methods to avoid memory leaks, but before I do so, I'd like to understand where things are getting retained so I can recognize such problems in the future. The console results were surprising to me.

The value you get back from -retainCount is an unsigned int.

You're using %i in the format string, which is for signed integer. Try changing it to %u and see what the results are.

    - Scott

--
http://treehouseideas.com/
http://theobroma.treehouseideas.com/ [blog]

_______________________________________________
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


References: 
 >newbie memory question (From: Daniel Child <email@hidden>)

  • Prev by Date: NSTableView problem: selector not recognized.
  • Next by Date: Re: Connecting a progress bar to standard C code?
  • Previous by thread: newbie memory question
  • Next by thread: Re: newbie memory question
  • Index(es):
    • Date
    • Thread