Reputation: 993
I'm trying to understand what the Allocations instrument in Xcode is telling me. I am using ARC. I have the following methods in the DetailViewController of my master-detail app:
- (FFMasterViewController*) masterViewController
{
return (FFMasterViewController*)[[self.splitViewController.viewControllers objectAtIndex:0] topViewController];
}
- (SQLDataController*) sqlDataController
{
return self.masterViewController.dataController;
}
The first method seems to be fine. But the second one, according to Allocations, is causing 100.0% of a memory leak. dataController is an ivar in my MasterViewController. I wrote both methods to make it convenient to refer to the MasterViewController and the DataController from methods in my DetailViewController. I can show more code, but I'm not sure what to look at next to find the leak. I don't understand how returning a pointer in one case is fine but in another causes a leak.
Upvotes: 1
Views: 92
Reputation: 162722
It is telling you where the leak was allocated, not what is causing the leak.
Since you are using ARC, more likely than not, you have a retain cycle somewhere.
If you look in the allocations instruments, you can turn on "track reference counting events" and "only track live allocations", then you can dive in and see all the retain/release events on the objects being leaked.
Upvotes: 2