in TableView.m:
When I tap the accessorybutton, I want a detailview to be loaded with the data from the selected cell.
Loading the attributes from the Goal entity is not a problem
but I want to load the relationships too..
But how do I get an object out of the NSSet ?
And how can I turn it into a NSString?
Is this possible in the same way as I load the description and name attributes? Or do I need a fetch request ?
Code:
- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
NSString *selectedCell = cell.textLabel.text;
NSLog(@"Toon mij het extra venster om details weer te geven/aan te passen van: %@", selectedCell);
if(buttonPushed == @"Goals"){
GoalDetailViewController *goalDetail = [[GoalDetailViewController alloc] initWithNibName:@"GoalDetailViewController" bundle:[NSBundle mainBundle]];
goalDetail.context = context;
goalDetail.title = goalDetail.goal.goalNaam;
Goal *goal = [arr objectAtIndex:indexPath.row];
goalDetail.goal = goal;
[self.navigationController pushViewController:goalDetail animated:YES];
When I tap the accessorybutton, I want a detailview to be loaded with the data from the selected cell.
Loading the attributes from the Goal entity is not a problem
Code:
descriptionField.text = goal.goalDescription;
nameTextField.text = goal.goalName;
but I want to load the relationships too..
But how do I get an object out of the NSSet ?
And how can I turn it into a NSString?
Is this possible in the same way as I load the description and name attributes? Or do I need a fetch request ?