Being a noob in Iphone dev, just trying to understand.
In the code below, what is happening exaclty?
City *newCity = [[City alloc] init];
newCity.name = @"name";
NSMutableArray *array = [[NSMutableArray alloc] init];
[array addObject:newCity];
City *getCity = [array objectAtIndex:0];
[city release];
[array release];
when you add an object to the array, does the array do a retain or does it create a whole new instance?
Also when I do a objectAtIndex to retrieve the city. Am I suppose to release it? Im assuming not since I don't own it? Is this how I should think?
Also when I do release on the array, does it iterate through all the object in the array and call a release on those object as well?