2013-02-07 3 views
0

@synthesize mCallnumberCallmethod에 선언 할 수 없습니다. 오류가 발생한다고 선언하면 헤더에서 선언하려고하면 오류가 발생하고 앱이 종료됩니다.이 도움말은 매우 유용합니다. -기음. 당신의 "contactsViewController".H 파일에주소록 peoplePickerNavigationController

@property (retain) NSString * mCallNumber; 

: 것보다는 아마

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

답변

0

더 당신은 단순히라는 한 줄을 추가해야합니다.

B.T.W., 목표 C 모범 사례는 클래스 이름의 첫 번째 문자를 대문자로 만들고 모든 변수의 첫 문자를 소문자로 유지하는 것입니다. 따라서 "contactsViewController"대신 "ContactsViewController"이라고 부릅니다.

+0

Callmethod에서 아래 그림과 같이 CallViewController.m을 호출합니다. – reddy

0

시험해보고 효과가 있는지 확인하십시오.

@property(nonatomic,retain) NSString *mCallNumber;