One mistake I see in your code is that you have this:
if (ABAddressBookRequestAccessWithCompletion != NULL) {
This should be:
if (ABAddressBookGetAuthorizationStatus() == kABAuthorizationStatusNotDetermined) {
The problem with your original code is that ABAddressBookRequestAccessWithCompletion
is not anything: it requires parameters, like you use later on in the same if
statement. I am surprised you are not getting an error from Xcode. ABAddressBookGetAuthorizationStatus
was new in iOS 6.
Also, you are supposed to create the Address Book Ref after you get permission, not before.
It is also possible that because the app was on your iPhone at some point, it remembers that you gave permission to the app to use your contacts. In the iOS simulator, there is a Reset Content and Settings option. This makes the simulator forget any permission settings you gave your app. I find it unlikely that you want to reset your iPhone, correct?