ストーリーボードで詳細ビューにプッシュしようとしましたが、機能していません。
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([[segue identifier] isEqualToString:@"drinkList"])
{
NSIndexPath *myIndexPath = [self.drinksCatTable indexPathForSelectedRow];
if (myIndexPath.row ==0) //if selected is row 1
{
selectedDrinkCat =[segue destinationViewController];
Drinks *drinkList = [aDelegate.categoryArray objectAtIndex:0];//forward all drinks to drinksList
selectedDrinkCat.drinkList = drinkList;//point drinkList to the next view drinkList
selectedDrinkCat.allDrinkStr = @"All";//all drinks selected
NSLog(@"aaa");
}
else
{
Drinks *drinkList = [aDelegate.categoryArray objectAtIndex:(myIndexPath.row)-1];//we have to minus 1 as the row had en extra "All" row which is not in the database
selectedDrinkCat.drinkList = drinkList;
selectedDrinkCat.allDrinkStr =@"cat";
NSLog(@"1111");
}
}
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[self performSegueWithIdentifier:@"drinkList" sender:self];
NSLog(@"called did select");
}