2013-04-01 50 views
0

我用下面的代碼用於此目的從通訊錄問題取數

ABMultiValueRef phones = (ABMultiValueRef)ABRecordCopyValue(ref, kABPersonPhoneProperty); 
     NSString* [email protected]""; 
     NSString* mobileLabel; 
     for (int i=0; i < ABMultiValueGetCount(phones); i++) { 
      //NSString *phone = (NSString *)ABMultiValueCopyValueAtIndex(phones, i); 
      //NSLog(@"%@", phone); 
      mobileLabel = (NSString*)ABMultiValueCopyLabelAtIndex(phones, i); 
      if([mobileLabel isEqualToString:(NSString *)kABPersonPhoneMobileLabel]) { 
       NSLog(@"mobile:"); 
      } else if ([mobileLabel isEqualToString:(NSString*)kABPersonPhoneIPhoneLabel]) { 
       NSLog(@"iphone:"); 
      } else if ([mobileLabel isEqualToString:(NSString*)kABPersonPhonePagerLabel]) { 
       NSLog(@"pager:"); 
      } 
      [mobile release]; 
      mobile = (NSString*)ABMultiValueCopyValueAtIndex(phones, i); 
      NSLog(@"%@", mobile); 
      [_Phonearray addObject:mobile]; 
     } 

我現在的問題是_phonearray的是NSLog的是這樣的

_

Phonearray(
    "(658) 932-6593", 
    "(654) 498-9878" 
) 

但我要像

_Phonearray(
    "6589326593", 
    "6544989878" 
) 

那麼我應該在代碼中做些什麼?

回答