Reputation:
When I navigate to another view controller with y=this two lines it works ok.
Inventory *obj = [[Inventory alloc] initWithNibName:@"Inventory" bundle:nil];
[self.navigationController pushViewController:obj animated:YES];
But if i write this line [Which we must write]
[obj release];
It gives me bad access error.
Pls help.
Thanks
Upvotes: 0
Views: 58
Reputation: 588
Inventory *obj = [[[Inventory alloc] initWithNibName:@"Inventory" bundle:nil] autorelease]
Upvotes: 1
Reputation: 49730
your object of class was Released then it access again that object who already released so you got this bad access error. please read this following link Article for Understanding EXC_BAD_ACCESS
Upvotes: 1