i have a table view in the first screen i click on the add button n go add details there (first name ,last name and age) and save. Its saved n gets me to the parent screen,den wen i click on the accessory indicator i want to go the same view n see those details of my selected row in those text fields. Im using segue's n passing the object, the object is passed but i dont see it in the textfields ,i get a the screen with empty textfields.thanks showing the code below:

-(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
   {

     if([segue.identifier isEqualToString:@"AddNew"])


    {
          addNewController = segue.destinationViewController;

           addNewController.delegate = self;

}
else if ([segue.identifier isEqualToString:@"ShowRow"])
{
    NSIndexPath *pathChosen = self.tableView.indexPathForSelectedRow;


    personObject = [self.personArray objectAtIndex:pathChosen.row];
    NSLog(@"the row selected is %@",personObject);


    self.addNewController = segue.destinationViewController;
    self.addNewController.personObject = self.personObject;
     self.addNewController.personObject = self.personObject;

    self.personObject.firstName = addNewController.firstNametxt.text;
    NSLog(@"the row selected is %@",addNewController.firstNametxt.text);
   //its giving me a null value here for addnewcontroller.firstNametxt.text.




}

}

没有正确的解决方案

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top