I need to get phone number from contacts.
For that my code is
- (IBAction)contacts {
NSLog(@"contacts clicked ");
ABPeoplePickerNavigationController *peoplePickerController = [[ABPeoplePickerNavigationController alloc] init];
peoplePickerController.peoplePickerDelegate = self;
[self presentModalViewController:peoplePickerController animated:NO];
[peoplePickerController release];
}
- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker
shouldContinueAfterSelectingPerson:(ABRecordRef)person {
NSString *number = (NSString *)ABRecordCopyValue(person, kABPersonPhoneProperty);
NSLog(@" %@",number);
return YES;
}
here it displays in console like this
ABMultiValueRef 0x740b680 with 1 value(s)
0: _$!<Mobile>!$_ (0x7419880) - (929) 230-8622 (0x740b490)
Here (929) 230-8622 is mobile number,How can i get only mobile number.
After selecting contact i need to close this view controller.
For that i write code like this
[self dissmissModalViewControllerAnimated:YES];
But it shows waning that myclass may not respond to dissmissModalViewController.
How can i done that after selection i need to close this view controller.
can anyone pls help me.
Thank u in advance.
I resolve my problem using By Adding this code.
Hope this helpful who face problem like me.