我無法在Callmethod
中聲明@synthesize mCallnumber
。如果我聲明它是拋出錯誤,並且當我嘗試在頭中聲明它時,它也會拋出錯誤,並且應用程序會終止。請大家幫忙,因爲我對這個目標非常陌生-C。地址簿peoplePickerNavigationController
-(IBAction)gotohomepage:(id)sender
{
[self dismissViewControllerAnimated:YES completion:nil];
}
- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person
{
[email protected]"";
[email protected]"";
[email protected]"";
[email protected]"";
mFirstName.text=(NSString *)ABRecordCopyValue(person, kABPersonFirstNameProperty);
mLastName.text=(NSString *)ABRecordCopyValue(person, kABPersonLastNameProperty);
ABMultiValueRef phoneIdIndex=ABRecordCopyValue(person,kABPersonPhoneProperty);
CFIndex thePhoneIndex=ABMultiValueGetCount(phoneIdIndex);
if (thePhoneIndex!=0) {
mPhoneNumber=(NSString *)ABMultiValueCopyValueAtIndex(phoneIdIndex, 0);
mContactNumber.text=mPhoneNumber;
}
ABMultiValueRef emailIdIndex=ABRecordCopyValue(person, kABPersonEmailProperty);
CFIndex theEmailIndex=ABMultiValueGetCount(emailIdIndex);
if (theEmailIndex!=0) {
mEmailIdIndex=(NSString *)ABMultiValueCopyValueAtIndex(emailIdIndex, 0);
mEmailId.text=mEmailIdIndex;
}
[self dismissModalViewControllerAnimated:YES];
mCall.hidden=NO;
mEmail.hidden=NO;
mSMS.hidden=NO;
return NO;
}
- (void)peoplePickerNavigationControllerDidCancel:(ABPeoplePickerNavigationController *)peoplePicker
{
[self dismissModalViewControllerAnimated:YES];
}
- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier
{
return YES;
}
-(IBAction)callmethod
{
contactsViewController *actionHandleView=[[contactsViewController alloc]initWithNibName:@"contactsViewController" bundle:nil];
actionHandleView.mCallNumber=mPhoneNumber;
[self.navigationController pushViewController:actionHandleView animated:YES];
[actionHandleView release];
}
在Callmethod中我調用CallViewController.m,如下所示 – reddy