I am trying to pass a string between two view controllers in a storyboard, core data program. The way I have it set up I want the next view to be pushed only for one section only. Hence the use of "didSelectRowAtIndexPath" rather than "prepareForSegue". Below is my code for "didSelectRow…" "five" is the viewController class being pushed.
- (void)tableView:(UITableView *)tableView
didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.section == 0)
{
five *five=[[five alloc]init];
five.delegate = self;
[self performSegueWithIdentifier:@"segue1" sender:self];
}
}
"two" is the parent view. Below is the method used in a protocol created in the "five" class. "friendString" is in the "two" class and "fiveString" in "five". When the view is popped, the strings should be the same and then I use the string added in "five" in a UITextField in "two". However it doesn't update when the view is popped.
- (void)popFive:(five *)controller
{
self.friendString=controller.fiveString;
[self update];
[self.tableView reloadData];
}
I believe the problem is related to how the seque is done in "didSelectRow…" Any help or ideas will be appreciated. Thanks.