Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

justmyself

macrumors member
Original poster
Jan 2, 2009
32
0
I've been wanting to develop for the iphone and had a couple of questions. How does the init alloc and release memory stuff work. When do you init? allow? and when do you release? I know it's probably pretty basic but it's nothing I've dealt with and I hear you have to manage memory with the iphone? FWIW I'm currently using 10.4 and have developed a couple of apps but I want to know they brought over to the iphone before I go out and buy 10.5

Thanks
 

detz

macrumors 65816
Jun 29, 2007
1,051
0
Google it too, there are some great blog posts about it out there. Memory management is probably one of the hardest things to wrap you head around as a beginner because you're dealing with reference counters etc...but once you understand it it's pretty easy.

Basically, If you alloc an object you have to release it. There are more complicated things like autorelease and copy but first you have to understand the basics.
 

xsmasher

macrumors regular
Jul 18, 2008
140
0
I've been wanting to develop for the iphone and had a couple of questions. How does the init alloc and release memory stuff work. When do you init? allow? and when do you release? I know it's probably pretty basic but it's nothing I've dealt with and I hear you have to manage memory with the iphone?

This page put it all together for me:
http://www.stepwise.com/Articles/Technical/2001-03-11.01.html

It also has right way & wrong way examples.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.