开发学院手机开发iPhone 开发 iPhone 取得用户的电话本 代码 阅读

iPhone 取得用户的电话本 代码

 2010-12-18 08:05:48 来源:WEB开发网   
核心提示:values = (ABMultiValueRef) ABRecordCopyValue(personRef , kABPersonPhoneProperty);//NSLog(@"values===%@",values);NSString *getPhoneNum;for(j = 0 ;j <

values = (ABMultiValueRef) ABRecordCopyValue(personRef , kABPersonPhoneProperty);

//NSLog(@"values===%@",values);

NSString *getPhoneNum;

for(j = 0 ;j < ABMultiValueGetCount(values); j++) {

getPhoneNum = [NSString stringWithFormat:@"%@", (NSString *)ABMultiValueCopyValueAtIndex(values, j)]; }if(ABMultiValueGetCount(values)==0){

getPhoneNum=@"空";

}//NSLog(@"getPhoneNum=====%@",getPhoneNum); // values = (ABMultiValueRef) ABRecordCopyValue(personRef , kABPersonEmailProperty);// for( j = 0 ;j < ABMultiValueGetCount(values); j++)// { // NSLog(@"1-%@", (NSString *)ABMultiValueCopyValueAtIndex(values, j));// // }// // values = (ABMultiValueRef) ABRecordCopyValue(personRef , kABPersonAddressProperty);// for( j = 0 ;j < ABMultiValueGetCount(values); j++)// { // NSLog(@"2-%@", (NSString *)ABMultiValueCopyValueAtIndex(values, j));// // }[jsonDictionary setObject:getPhoneNum forKey:allName] ; //============================================================================== }

//NSLog(@"addressbook=%@",jsonDictionary); NSString *str = [jsonDictionary JSONRepresentation];NSLog(@"str===%@",str); // NSString *d = [str JSONValue];[jsonDictionary release];

// NSString *str = [jsonDictionary JSONRepresentation];// NSMutableDictionary *d = [jsonDictionary JSONValue];// NSLog(@"%@" , [d description]); // [dlist release];//NSLog(@"addressbook=%@",jsonDictionary);}

上一页  1 2 

Tags:iPhone 取得 用户

编辑录入:爽爽 [复制链接] [打 印]
[]
  • 好
  • 好的评价 如果觉得好,就请您
      0%(0)
  • 差
  • 差的评价 如果觉得差,就请您
      0%(0)
赞助商链接