Link to home
Start Free TrialLog in
Avatar of ambush276
ambush276

asked on

Iphone People Picker Controller

ok so i have this code so far.

- (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
            }
        } ]

Open in new window


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(automatically), grabs text from the variable saved on the ABPeoplePickerViewcontroller


i know this is not too hard... but im having problems doing it..

Thanks!
Avatar of darbid73
darbid73
Flag of Germany image

Hi ambush276,

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.
ASKER CERTIFIED SOLUTION
Avatar of smugmonkey
smugmonkey
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ambush276
ambush276

ASKER

not totally clear