I am developing an IOS application. How can I get the object from NSArray list. What is the best way to avoid getting memory error? Can you tell me the correct method? Thanks
Recommendation 1
Person *person = [[[Person alloc] init] autorelease];
person = [self.userFavourites objectAtIndex:0];
Recommendation 2
Person *person = [self.userFavourites objectAtIndex:0];
[person retain];
//Make the required action
[person release];