Reputation: 1312
I have two view controller e.g. controller A and Controller B i am presenting a controller B on click of a button on controller A by using this code
- (IBAction)CategoriesTapped:(id)sender {
CategoriesViewController * category=[[CategoriesViewController alloc]initWithNibName:@"CategoriesViewController" bundle:Nil];
[self presentViewController:category animated:YES completion:^
{
NSLog(@"Loaded...");
}
];
}
and i am dismissing this controller on click of button on controller B as :
- (IBAction)CloseTapped:(id)sender {
[self dismissViewControllerAnimated:YES completion:^
{
NSLog(@"dismissed...");
}
];
}
It works fine the first time, but when I try to present this controller again, the app crashes with exc_bad_access. I can't figure out what the problem actually is so please can anybody help me out of this situation? Thanks in advance.
Upvotes: 1
Views: 581