0

I am not able to declare @synthesize mCallnumber in Callmethod.If i declare it is throwing error and when i try declaring it in header then also it throws error and app gets terminated.Kindly help as i am very new to this Objective-C.

 -(IBAction)gotohomepage:(id)sender
{
[self dismissViewControllerAnimated:YES completion:nil];
}

- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person

{
mContactNumber.text=@"";
mEmailId.text=@"";
mFirstName.text=@"";
mLastName.text=@"";

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];
 }
Cephalopod
  • 14,632
  • 7
  • 51
  • 70
reddy
  • 13
  • 10

2 Answers2

0

More than likely you only simply need to add a line that says:

@property (retain) NSString * mCallNumber;

to your "contactsViewController" .h file.

B.T.W., Objective C best practices are to capitalize the first character of a Class name and keep the first character of all variables lower case. So instead of "contactsViewController", call it "ContactsViewController".

Michael Dautermann
  • 88,797
  • 17
  • 166
  • 215
0

Try this and see if it works.

@property(nonatomic,retain) NSString *mCallNumber;
Newbee
  • 265
  • 3
  • 9
  • 22