Retain, alloc, properties ... Topic to make your Obj-c life easier !
- by gotye
Hey everyone,
The more I code, the more I get lost ... so I decided to create a topic entirely dedicated to the memory management for me (and others) not to waste hours understanding obj-c basics ... I'll update it as new questions are asked !
Okay below is some examples :
// myArray is property (retain)
myArray = otherArray;
//myArray isn't a property
myArray = otherArray;
//myArray is a property (retain)
myArray = [[NSArray alloc] init];
//myArray isn't a property
myArray = [[NSArray alloc] init];
Could you explain to me what happens in every cases ? And especially the number 3 ;)
Thanks for the time.
Gotye.