ambush276
asked on
Iphone People Picker Controller
ok so i have this code so far.
what i want to do is when someone taps on the number in the lastview ... to then copy the text from that number and store it in a variable, and then move to a different view controller, and retrieve the text from that variable..
recap:
person selects last number from ABPeoplePicker ,
then saves that number in a variable, goes to a different viewcontroller(automatical ly), grabs text from the variable saved on the ABPeoplePickerViewcontroll er
i know this is not too hard... but im having problems doing it..
Thanks!
- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person
property:(ABPropertyID)property
identifier:(ABMultiValueIdentifier)identifier
{
NSString *phbook= [[NSUserDefaults standardUserDefaults] stringForKey:@"phbooks"];
if (property == kABPersonPhoneProperty) { // if tapped is equal to a phone property
CFStringRef cfnumber;
ABMultiValueRef numbers = ABRecordCopyValue(person, kABPersonPhoneProperty);
for(CFIndex i = 0; i < ABMultiValueGetCount(numbers); i++) {
if(identifier == ABMultiValueGetIdentifierAtIndex (numbers, i)) { //if tapped number identifier is the same as identifier number tapped
cfnumber = ABMultiValueCopyValueAtIndex(numbers, i); // copy the number to CFSTRING number
}
} ]
what i want to do is when someone taps on the number in the lastview ... to then copy the text from that number and store it in a variable, and then move to a different view controller, and retrieve the text from that variable..
recap:
person selects last number from ABPeoplePicker ,
then saves that number in a variable, goes to a different viewcontroller(automatical
i know this is not too hard... but im having problems doing it..
Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
not totally clear
In the new view controllers class add a new variable of the same type as you want here. You add this variable to both files. Then after you have called the new view controller you simply pass the variable value from what you have above to the newly created class of the view controller. Remember that you have to pass your variable to the same instance of the class that you are using for your view controller.