views:

46

answers:

2

This piece of code works fine. However, if I change the animated parameter to YES it crashes.

AccountViewController *accViewController = [[AccountViewController alloc] initWithNibName:@"Account" bundle:nil]; 
[self.navigationController pushViewController:accViewController animated:NO];
[accViewController release];

What could be wrong?

A: 

Try dropping the release call. Although I would assume that push should retain, I can't recall for sure and i am not sure when it retains.

Peter DeWeese
+1  A: 

Are you doing this while any other animation is going on? I've seen crashes here in that type of situation (for example, while one view is being dismissed, pushing or presenting another will crash.)

Ben Gottlieb