Makes the library view display a list of monsters.
Makes the library view ad search view share a view controller for their destination.
This commit is contained in:
@@ -29,14 +29,13 @@
|
||||
|
||||
#pragma mark - Navigation
|
||||
|
||||
// In a storyboard-based application, you will often want to do a little preparation before navigation
|
||||
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
|
||||
// Get the new view controller using [segue destinationViewController].
|
||||
// Pass the selected object to the new view controller.
|
||||
if ([@"ShowMonsterDetail" isEqualToString:segue.identifier]) {
|
||||
NSIndexPath *indexPath = [self.searchResults indexPathForSelectedRow];
|
||||
MonsterViewController *vc = (MonsterViewController*)segue.destinationViewController;
|
||||
vc.monster = [self.foundMonsters objectAtIndex:indexPath.row];
|
||||
if ([segue.destinationViewController isKindOfClass:[MonsterViewController class]]) {
|
||||
MonsterViewController *vc = (MonsterViewController*)segue.destinationViewController;
|
||||
vc.monster = [self.foundMonsters objectAtIndex:indexPath.row];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user