myroot.delegate=self;
[self.window makeKeyAndVisible];
return YES;
}
- (void)tabBarController:(UITabBarController *)tabBarController
didSelectViewController:(UIViewController *)viewController
{
//tabBarController.delegate = self;
NSLog(@"User selected %@ from the tabbar",viewController);
// viewController.view.backgroundColor=[UIColor blackColor];
if ([viewController isKindOfClass:[otherViewController class]]) {
otherViewController* view=(otherViewController*)viewController;
NSString *path = [NSString stringWithFormat:@"%@/Documents/save.dat", NSHomeDirectory()];
NSData *data2 = [NSData dataWithContentsOfFile:path];//读取文件
// view.datalist=[[NSMutableArray alloc]init];
view.datalist = [NSKeyedUnarchiver unarchiveObjectWithData:data2];//反序列化
NSLog(@"herehrer...%d",[view.datalist count]);
[view.table reloadData];
}
这是设置每次点击前刷新数据源的操作,子啊appdelegate。m中设置的,没想到还可以这样做。
}