My app crashed and the code is the following:
else if(...)
{
CGDetailView *detailView = [[CGDetailView alloc] init];
ContactGroup *contactGroup = [[ContactGroup alloc] init];
[contactGroup setObjectStatus:NewObject];
[detailView setContactGroup:contactGroup];
[detailView newContactGroup:YES];
[contactGroup release];
UIBarButtonItem *temporaryItem=[[UIBarButtonItem alloc] init];
temporaryItem.title = NSLocalizedString(@"back", @"");
self.navigationItem.backBarButtonItem = temporaryItem;
[temporaryItem release];
[[self navigationController] pushViewController:detailView animated:YES];
[detailView release];
}
The error is "message sent to deallocated instance" and it regards the object of type CGDetailView. I use the alloc-init-release pattern, and I don't really understand why the app crashed. It usually works.
iOS 7.1 and device is iPhone5 if that helps.