In my application i declare an array property,
@property (nonatomic, retain) NSArray *listOfItems;
and in my viewDidLoad method,
listOfItems = [[NSArray alloc] initWithObjects:@"First", @"Second", nil];
I do not release the array in my viewDidLoad, because the objects in the array will be required elsewhere in the application.
Finally in my dealloc method i put,
[listOfItems release];
My question is: Is there a memory leak in this code? The retain count should be increased twice due to the (retain) in the property as well as the alloc in the viewDidLoad, but only decreased once in the dealloc method.