Hello everyone (sorry for my english). I’m new with objetive-C and iOS programming. May you help me?
@interface RootViewController : UITableViewController
{
NSMutableArray *keysFromQuery;
}
@property (nonatomic, retain) NSMutableArray *keysFromQuery;
....
....
NSString *category = [keysFromQuery objectAtIndex:0];
What will happen with [keysFromQuery objectAtIndex:0] if I do: [category release];?
What will happen with category if I do after that: [keysFromQuery release];?
I don’t know well how references and memory mechanisms work.
Thanks!
Don’t call
-releaseoncategory. You don’t own the object. You must only release objects which you have taken ownership of, via NARC (new/alloc/retain/copy). For more info read the Memory Management Programming Guide.