在FirstViewControlle.h
定义一个NSMutableArray
像:
@property (nonautomic, retain) NSMutableArray *tableArray;
在FirstViewController.m
合成它像:
@synthesize tableArray;
在最后添加此行的saveNewCard
方法中:AddNewCardViewController
-(IBAction)saveNewCard:(id)sender{
.....
.....
FirstViewController *firstView = (FirstViewController*)[self.navigationController.viewControllers objectAtIndex:self.navigationController.viewControllers.count-2];
[firstView.tableArray addObject:newCard];
}
在viewWillAppear
方法中FirstViewController
也添加[myTableView reload];