Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 01-23-2009, 02:56 PM   #2 (permalink)
exorcyze
Registered Member
 
Join Date: Dec 2008
Posts: 495
Default

There are much more in-depth discussions on the matter, but in a nutshell, you only need to release anything that you "own". You generally own any *objects* that you send a message that contains "alloc" or "copy".

Objects created with convenience constructors are auto-released. Generally at the end of the current method.

Code:
// you own this one, need to release
NSString *myString = [[NSString alloc] initWithFormat:@"Hello %@", @"world"];

// convenience constructor, will be auto-released
NSString *myString = [NSString stringWithFormat:@"Hello %@", @"world"];
__________________
My Apps on AppStore : gScale (guitar scales reference), eMaze, eMaze Lite, eTimesheet
exorcyze is offline   Reply With Quote
 

» Advertisements
» Online Users: 637
14 members and 623 guests
apatsufas, ckgni, Dani77, Domele, drewrico, handmachine, Harisstimolth5, JamesCahall, Janyeok, mistergreen2011, Monstertaco, noobAppDeveloper, Oral B, rimap123
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,789
Threads: 89,205
Posts: 380,603
Top Poster: BrianSlick (7,129)
Welcome to our newest member, Harisstimolth5
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 12:29 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.