user1831389
user1831389

Reputation: 201

Import particular contact details from addressbook in iphone

In my app I import a contact details using addressbookui.In case of email or mobile number empty my app getting crashed.

Upvotes: 0

Views: 417

Answers (1)

Aman Aggarwal
Aman Aggarwal

Reputation: 3754

For email try this:

 ABMutableMultiValueRef eMail  = ABRecordCopyValue(ref, kABPersonEmailProperty);

    if(ABMultiValueGetCount(eMail) > 0) 
 {
      NSString *personEmail =  (NSString *)ABMultiValueCopyValueAtIndex(eMail, 0);
  }

Upvotes: 1

Related Questions