title: IOS::How to get the contact number from ABAddressBook
body: <p>Phone number getting like this.
  Phone ABMultiValueRef 0x17674380 with 1 value(s)
      0: <em>$!!$</em> (0x176740e0) - 7124779070 (0x176742a0)</p>
  
  <p>How to get this number"<strong>7124779070</strong>" from the above line.</p>
  
  <p>I'm using this code for ios 7.Is it correct or wrong ,Please sugggest me.</p>
  
  <pre><code> int i;
      ABAddressBookRef contactBook = ABAddressBookCreateWithOptions(NULL, NULL);
      NSMutableArray *allData = ( NSMutableArray *)(ABAddressBookCopyArrayOfAllPeople(contactBook));
      CFIndex contactNum = CFArrayGetCount((__bridge CFArrayRef)(allData));
  
      for (i = 0; i &lt; contactNum; i++)
      {
          ABRecordRef ref = CFArrayGetValueAtIndex((__bridge CFMutableArrayRef)(allData), i);
          NSString*  firstName = ABRecordCopyValue(ref, kABPersonFirstNameProperty);
          NSString* lastName = ABRecordCopyValue(ref, kABPersonLastNameProperty);
          NSString*  phonesNum = ABRecordCopyValue(ref, kABPersonPhoneProperty);
  
          // Remove all formatting symbols that might be in both phone number being compared
          NSCharacterSet *toExclude = [NSCharacterSet characterSetWithCharactersInString:@"/.()- "];
          phonesNum = [[phonesNum componentsSeparatedByCharactersInSet:toExclude] componentsJoinedByString: @""];
      NSString *phoneNumber = [[phonesNum componentsSeparatedByCharactersInSet:toExclude] componentsJoinedByString: @""];
  
  
  
          NSMutableDictionary *dic = [[NSMutableDictionary alloc] init];
          if (firstName!=nil)
          {
              [dic setObject:(__bridge id)(firstName) forKey:@"firstName"];
  
          }
          if (lastName !=nil) {
              [dic setObject:(__bridge id)(lastName) forKey:@"lastName"];
  
          }
          if (phonesNum!=nil) {
              [dic setObject:(__bridge id)(phonesNum) forKey:@"phonesNum"];
          }
  
          [arr_Contacts addObject:dic];
  
          NSLog(@"First name %@", firstName);
          NSLog(@"Last Name %@", lastName);
          NSLog(@"Phone %@", phonesNum);
      }
  </code></pre>