I have a really light ViewController, it does nothing in viewDidLoad. I\'m pushing this view on top of a navigationController. The method who does this action is called from
From the docs for ABAddressBookRequestAccessWithCompletion
:
The completion handler is called on an arbitrary queue. If your app uses an address book throughout the app, you are responsible for ensuring that all usage of that address book is dispatched to a single queue to ensure correct thread-safe operation.
You should make sure your UI code is called on the main thread.
ABAddressBookRequestAccessWithCompletion(addressBookRef, ^(bool granted, CFErrorRef error {
dispatch_async(dispatch_get_main_queue(), ^{
[self showView];
NSLog(@"EXECUTED");
});
});
This might not be the only problem, but according to the docs, the completion handler passed to ABAddressBookRequestAccessWithCompletion
is called on an arbitrary queue. -showView
should only be called on the main queue since it is dealing with UIViewController
objects.
The other thing to ask is what else is happening on the main queue? Are there other long-running tasks that could be blocking UI updates?