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 07-05-2009, 01:25 AM   #5 (permalink)
smasher
Senior Member
iPhone Dev SDK Supporter
 
smasher's Avatar
 
Join Date: Jul 2008
Location: San Mateo, CA (San Fran)
Posts: 3,858
Default

Quote:
Originally Posted by oohmyygoood View Post
Interesting. It doesn't say in the Class Ref Library that buttonWithType returns an autorelease object.

Is this the case for other non-initWithXxxxxx methods that create and return objects as well? Such as [NSString stringWithString:] for instance?

I guess my question is if the rule is to only release objects that were created using an [.... alloc] init....] combo and all other methods return autorelease objects?
Yes. Unless the method has init or a copy in the name, assume it returns an autoreleased objects, or maybe a singleton or shared instance. Either way, if you did not init/copy/retain then you should not release.
__________________

Free Games!
smasher is offline   Reply With Quote
 

» Advertisements
» Online Users: 322
16 members and 306 guests
ADY, apatsufas, chemistry, Fit4him, headkaze, ilmman, MarkC, marto1914, Meoz, PsychoChris, sly24, sneaky, Sunny46, tgjorgoski, Thrillhouse1919, vogueestylee
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,877
Threads: 89,222
Posts: 380,718
Top Poster: BrianSlick (7,129)
Welcome to our newest member, peterkessler45
Powered by vBadvanced CMPS v3.1.0

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