Thursday, 19 September 2013

xcode 5 changes? proper way to pass data along table views?

xcode 5 changes? proper way to pass data along table views?

I have a stack of table view controllers. a subject-->category-->group-->card
I'm using core data. In the first table view controller I fetch all
'subjects'. the user selects a subject and the subject is passed to the
next table view controller using a 'didSelectSegue' and a
'prepareForSegue', setting a property from the category view in the
'prepare' method.
this works fine for this segue! In the category table view I populate the
table with the categories in the subject, instead of fetching data from
the sqlite database I use 'subjects.categories' as it is a one to many
relationship.
I then want to perform the segue to the Group table view. I get this error
unrecognized selector sent to instance
This is confusing to me, as the same exact mechanism of passing an object
to the next table view works fine the first time. I believe its a problem
with ARC, but the whole subject is pretty vague for me.. Here is my
'prepare for segue' method,
- (void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
if ([[segue identifier] isEqualToString:@"groupView"]){
NSIndexPath * indexPath = [self.tableView indexPathForSelectedRow];
AHCategory *cellCategory = [self.categories
objectAtIndex:indexPath.row];
NSLog(@"%@",cellCategory.name);
[segue.destinationViewController setCategoryForGroups:cellCategory];
}
}
does anybody have any suggestions as to what this error means? thanks a lot..

No comments:

Post a Comment