I have developed an iPhone application that integrates a list of shopping registries,a To Do list and a Contact sub-app. The 'Contact' app has a GUI similar to the Info page on the iPhone's Contact app with ability to select a contact in the middle, and three buttons; Call, Sms, and Email at the bottom. When the user touches the 'Select Contact' button, the user can select a contact from 'All Contacts' in iPhone Contact app. The name, Email and Phone Number appear in my sub-app. Problem is...1) the Call button only dials 7 digit phone numbers. It will not dial 10 digit numbers.(very frustrating in Los Angeles area, a 10 digit call could be right across the street). 2). My Email function retrieves the email info, but when you touch the Email button...nothing happens. I'm still pretty new to developing. I have been a graphic designer for years. I'd very much appreciate any assistance offered. I'll attach relevant code so you can understand my problems better.
- (BOOL)peoplePickerNavigationController: (ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person {
ABMutableMultiValueRef phoneMulti = ABRecordCopyValue(person, kABPersonPhoneProperty);
NSMutableArray *phones = [[NSMutableArray alloc] init];
int i;
for (i = 0; i < ABMultiValueGetCount(phoneMulti); i++)
{
NSString *aPhone = [(NSString*)ABMultiValueCopyValueAtIndex(phoneMulti, i) autorelease];
// NSLog(@"PhoneLabel : %@ & Phone# : %@",aLabel,aPhone);
[phones addObject:aPhone];
}
NSString *mobileNo = [phones objectAtIndex:0];
phoneNo.text = mobileNo;
NSLog(mobileNo);
name.text = (NSString*)ABRecordCopyCompositeName(person);
ABMutableMultiValueRef emailMulti = ABRecordCopyValue(person, kABPersonEmailProperty);
NSMutableArray *emails = [[NSMutableArray alloc] init];
for (i = 0; i < ABMultiValueGetCount(emailMulti); i++) {
NSString *anEmail = [(NSString*)ABMultiValueCopyValueAtIndex(emailMulti, i) autorelease];
[emails addObject:anEmail];
}
if([emails count] > 0)
{
NSString *emailAdress = [emails objectAtIndex:0];
email.text = emailAdress;
NSLog(emailAdress);
}
[peoplePicker dismissModalViewControllerAnimated:YES];
Sorry to be so long winded but I this is my dilemna. Thanks in advance.
DigitalD