0825菜单参数的传递

来源:互联网 发布:如何有刘诗诗气质知乎 编辑:程序博客网 时间:2024/06/07 22:55





-(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








0 0