IOS开发基础之英雄展示完整版 // // ViewController.m // 15-英雄展示-单组数据 // // Created by 鲁军 on 2021/2/3. // #import "ViewController.h" #import "CZHero.h" @interface ViewController ()<UITableViewDataSource,UITableViewDelegate> @property(nonatomic,strong)NSArray *heros; @property (weak, nonatomic) IBOutlet UITableView *tableView; @end @implementation ViewController - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ //NSLog(@"%ld",(long) indexPath.row); CZHero *hero = self.heros[indexPath.row]; UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"编辑英雄" message:nil preferredStyle:UIAlertControllerStyleAlert]; UIAlertAction *conform = [UIAlertAction actionWithTitle:@"确认" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action){ //NSLog(@"点击了确认按钮"); NSLog(@"%@",action.title); // action.title }]