I wonder if it\'s a good habit to use NSAssert all over the place? What would be the benefit of doing that? In which situations is it a good idea to use it?
The major warning are side effects. If you write:
NSAssert([self.navigationController popViewControllerAnimated:YES]!=nil,@"Something fails");
popViewControllerAnimated: will be executed in the debug version, but not in the release version that strips NSAssert(). This means that your release version will behave different to the debug version.
This problem disappears if you are careful enough:
UIViewController* vc = [self.navigationController popViewControllerAnimated:YES];
NSAssert(vc!=nil,@"Something fails");