开发者

Get iPhone address book contacts in iphone application

I have an iphone applicat开发者_高级运维ion.Within which I want to get all the iphone address book contacts in an array.

Is that possible?


Yes. ABAddressBook is what you want.


Looks like it:

ABAddressBookRef addressBook = ABAddressBookCreate();
CFArrayRef allPeople = ABAddressBookCopyArrayOfAllPeople(addressBook);
CFIndex nPeople = ABAddressBookGetPersonCount(addressBook);

for( int i = 0 ; i < nPeople ; i++ ) {
  ABRecordRef ref = CFArrayGetValueAtIndex(allPeople, i );
  NSLog(@"inside loop");
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜