-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{WhyAddFoodController *addview=(WhyAddFoodController *)segue.destinationViewController;
addview.delgate=self;
}
-(void)addFoodViewControllerDidDone:(WhyAddFoodController *)addView andFood:(Food *)f
{
[foodArray addObject:f];
NSIndexPath *indexpath=[NSIndexPath indexPathForRow:[foodArray count]-1 inSection:0];
[self.tableView insertRowsAtIndexPaths:@[indexpath] withRowAnimation:UITableViewRowAnimationAutomatic];
[addView.navigationController popViewControllerAnimated:YES];
}
@class WhyAddFoodController;
@protocol WhyAddFoodControllerDelegate <NSObject>
-(void)addFoodViewControllerDidDone:
(WhyAddFoodController *)addView andFood:(Food *)f;
@end