I have a NSMutableArray property declared as (nonatomic, retain) called Categories. In dealloc, I release the memory for that variable. Originally, in viewDidLoad, I allocated that array and called another method that populated that data with dummy data. Basically
[categories addObject:someObject1];
[categories addObject:someObject2];
....
This was working.
Then I got the real data from a coworker in a method that talked to the model and returned an autoreleased array. I was getting EXC_BAD_ACCESS after I used the method.
categories = [datamanager GetCategories];
Now is that because I didn't retain the autoreleased array returned from the datamanager GetCategories method?
If so, I need to delete the alloc/init in viewDidLoad since that would be a memory leak right?
Thanks, just trying to make sure I'm understanding memory mgmt correctly.