EXC_BAD_ACCESS crash UINavigationController as ContentViewController
UINavigationController *mainNC = [[UINavigationController alloc] init]; mainNC.viewControllers = @[someController];
I instantiate REFrostedViewController with mainNC as contentViewController property:
REFrostedViewController *reFrostedVC = [[REFrostedViewController alloc] init]; reFrostedVC.contentViewController = mainNC; reFrostedVC.menuViewController = ...;
Everything works fine.
Later I want to set mainNC's viewControllers to some other view controllers like this: mainNC.viewControllers = @[someOtherVC];
The app crashes with EXC_BAD_ACCESS error.
If I call: [mainNC pushViewController:someOtherVC animated:NO];
It works fine, but this is not what I want.
OK, the problem has been encountered before, it is a iOS 7.1 thing:
- https://github.com/mwaterfall/MWPhotoBrowser/issues/121
- https://github.com/enormego/PhotoViewer/issues/33
- http://stackoverflow.com/questions/20251344/ios-crash-issue-exc-bad-access
- http://stackoverflow.com/questions/19183555/thread-1-exc-bad-access-code-1-address-0xf00000c
I managed to fix it by setting some scrollView's delegate to nil. Share your thoughts on this if you have something useful.
The moment I inherit a protocol in Login in which I have import REfrostedViewController.The app crashes at
- (id)init { self = [super init]; if (self) { [self commonInit]; } return self; } Thread 1: EXC_BAD_ACCESS (code=2, address=0x16ea0ffb0) What is the problem.I cant use protocol and delegates at this page at all.
In my App logs :libsystem_malloc.dylib`tiny_malloc_from_free_list:is showing