I am presenting a view controller modally in iOS app. The issue is that there is no crash and the app freezes as soon as presentViewController:animated is called. The stats show the CPU usage to be 100% and the usage doesn't go down even after manually closing the app.
UIStoryboard *sb = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
CustomModalViewController *vvc = [sb instantiateViewControllerWithIdentifier:@"CustomModalViewController"];
if(!vvc){
NSLog(@"ERROR!!! vvc is null");
}
NSLog(@"instantiate modal view controller");
vvc.providesPresentationContextTransitionStyle = YES;
vvc.definesPresentationContext = YES;
vvc.data = data;
NSLog(@"before presenting modal view controller");
[vvc setModalPresentationStyle:UIModalPresentationOverCurrentContext];
[self presentViewController:vvc animated:YES completion:nil];
I tried printing some debug statements in the viewDidLoad of my custom class, but those are also not getting called.
I don't understand why the view controller is not being displayed. Any help will be appreciated. I want to know in what case does your app go into infinite loop on pushing a view controller or is it because of some other cause??
UPDATE:
This error occured after I updated to XCode 7. Not sure, but I guess this might be an issue with new SDK- the UIKit or LLVM compiler. I copied my project to another mac with Xcode 6.4 and the error disappears!!! I haven't changed any build settings either that would cause the issue.
Any pointers on how to proceed?