|
Replies
:
1
-
Pages
:
1
-
Last Post
:
Aug 8, 2008 5:52 AM
by: Stephen Darling...
|
|
|
Posts:
121
Registered:
Jul 2, 2007
|
|
|
|
iPhone: Memory Management / Tracking Tools
Posted:
Aug 7, 2008 9:36 PM
|
|
|
I am new to Mac/iPhone programming but have 20+ years in Windows. I am not familiar with the tools but MS Dev Studio will show memory leaks as the app shuts down. Is there a similar switch to turn on for xcode? I am having trouble with the gestalt of memory management on this platform. For example, I know this is bad code style but is there a leak here?
myLabel.text = [@"Hello, World. " stringByAppendingString: myTextField.text];
Thanks,
Todd
|
|
Posts:
58
From:
London, UK
Registered:
Sep 24, 2004
|
|
|
|
Re: iPhone: Memory Management / Tracking Tools
Posted:
Aug 8, 2008 5:52 AM
in response to: halt00
|
|
|
I found section four of this document incredibly useful.
Broadly speaking, if you create an object using "alloc" you need to manually clean up afterwards, otherwise it will be autoreleased and you won't get a memory leak.
XCode comes with Instruments which allows you to track down leaks (among other things).
Cheers,
--> Stephen
MacBook C2D 2Ghz
Mac OS X (10.5.4)
|
|
|