title: Fetching array of contacts from ABAddressBookRequestAccessWithCompletion() gives nil
body: <p>I am trying to print out all of my phone's contacts to the console, using <code>NSLog()</code>. Currently this code is just printing <code>(null)</code>.</p>
  
  <p><strong>.h</strong></p>
  
  <pre><code>@property (nonatomic, strong) NSMutableArray *contactsObjects;
  </code></pre>
  
  <p><strong>.m</strong></p>
  
  <pre><code>@synthesize contactsObjects;
  //lazy instantiation. 
  - (NSMutableArray *)contactsObjects
  {
      if(!contactsObjects)
      {
          contactsObjects = [[NSMutableArray alloc]init];
      }
  
      return contactsObjects;
  }
  
  - (void)viewWillAppear:(BOOL)animated
  {
      CFErrorRef error = nil;
  
      // Request authorization to Address Book
      ABAddressBookRef addressBookRef = ABAddressBookCreateWithOptions(NULL, &amp;error);
  
      if (ABAddressBookGetAuthorizationStatus() == kABAuthorizationStatusNotDetermined) {
          ABAddressBookRequestAccessWithCompletion(addressBookRef, ^(bool granted, CFErrorRef error) {
              if (granted) {
                  // First time access has been granted, add all the user's contacts to array.
                  CFMutableArrayRef contactsObjects = ABAddressBookCopyArrayOfAllPeople(addressBookRef);
              } else {
                  // User denied access.
                  // Display an alert telling user that they must allow access to proceed to the "invites" page.
              }
          });
      }
      else if (ABAddressBookGetAuthorizationStatus() == kABAuthorizationStatusAuthorized) {
          // The user has previously given access, add all the user's contacts to array.
          CFMutableArrayRef contactsObjects = ABAddressBookCopyArrayOfAllPeople(addressBookRef);
      }
      else {
          // The user has previously denied access
          // Send an alert telling user that they must allow access to proceed to the "invites" page.
      }
  
      NSLog(@"%@", contactsObjects);
  }
  </code></pre>
  
  <p>I get two warnings here: </p>
  
  <p><img src="https://i.stack.imgur.com/m85s2.png" alt="enter image description here"></p>
  
  <p>I have no idea what I am supposed to do in order to properly print  the names and numbers of my contacts to the console.</p>
  
  <p>How do I print my contacts names and numbers?</p>