DBPostListViewController has a NSArray *postList that needs to be set.
I keep getting
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UITableViewController setPostList:]: unrecognized selector sent to instance 0x6e493d0
within the prepareForSegue for the setPostList function here:
NSArray *tempAry = [str componentsSeparatedByString:@"|@|"];
NSMutableArray *postArray = [[NSMutableArray alloc] initWithCapacity:[tempAry count]];
for (NSString *entry in tempAry) {
DBPost *tempPost = [[DBPost alloc] initWithString:entry];
[postArray addObject:tempPost];
}
DBPostListViewController *dest = [segue destinationViewController];
[dest setPostList:postArray];
Your error message explains it:
You send that message on these lines of code:
Objective-C is dynamically typed, so even though you’ve declared
destto be aDBPostListViewController, it could be any Objective-C object at all. And in this case it happens to be aUITableViewController.You forgot to set the custom class in your storyboard file, so UIKit is just making an instance of a plain UITableViewController. Fix your storyboard and re-run your app.