Advertise Books Events Forum News Social Networking Support Us

sdkIQ for iPhone
($4.99)

Shape Up
($0.99)

Your First iPhone App
($1.99)

iVidCam Free
(free)

Kid Art
($0.99)

iPUBQUIZ
(£1.19)

ArtStudio
($3.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 06-05-2009, 11:47 AM   #8 (permalink)
jsd
at this moment
 
Join Date: Mar 2009
Location: San Francisco, CA
Posts: 870
Default

Quote:
Originally Posted by MatuX View Post
And what if the property is set to assign instead of retain? When I do "release" I will render the allocated memory unusable?
Must I check for every property if its set to assign or retain every time I use it?
Nope. That's not your job. Your job is to balance your own retains and releases. (Of course, if you wrote the class that's getting the property, you're responsible for making it sure it works correctly.)

Release does not necessarily deallocate the object - only if its retain count drops to zero.

If you alloc an object, then assign it to a property of another class, you can go ahead and release it when you're done with it. It's up to the other class to have retained it (if it needs to). You shouldn't worry about it. Remember, as long as there's at least one retain on it, the object will not go away.

If you're worried about premature releases, check out the NSZombieEnabled flag. FCS Blog NSZombieEnabled for the debugger adverse
jsd is offline   Reply With Quote
 
Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Online Users: 242
16 members and 226 guests
dbonates, donbhar, Ed99, funhog, gardenofwine, inetryconydot, JasonR, jj0b, mriphoneman, pereorra, ravi124, redmouse, robertyang999, scotopia, VMan, _nivek
Most users ever online was 779, 05-11-2009 at 09:55 AM.
» Stats
Members: 24,276
Threads: 39,068
Posts: 171,322
Top Poster: smasher (2,575)
Welcome to our newest member, jstewuk
Powered by vBadvanced CMPS v3.1.0

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