A类委托B类:
1)新建一个协议 changeRowDelegate 包含一个方法 -(void)changeRow;
2)在A类增加@property(nonatomic,assign)id<changeRowDelegate > delegate , 在A类需要的地方 [delegate changeRow];
3) 在B类实例化A类 ,设置A类的代理为自己,最后实现协议方法 今天就是忘了设置代理为自己,发帖纪录下!
A *a = [[A alloc]init];
a.delegate = self
-(void)changeRow{
.......
}
再写个刷新某一行的方法
NSIndexPath *indexPath_1=[NSIndexPath indexPathForRow:1inSection:0];
1)新建一个协议 changeRowDelegate 包含一个方法 -(void)changeRow;
2)在A类增加@property(nonatomic,assign)id<changeRowDelegate > delegate , 在A类需要的地方 [delegate changeRow];
3) 在B类实例化A类 ,设置A类的代理为自己,最后实现协议方法 今天就是忘了设置代理为自己,发帖纪录下!
A *a = [[A alloc]init];
a.delegate = self
-(void)changeRow{
.......
}
再写个刷新某一行的方法
NSIndexPath *indexPath_1=[NSIndexPath indexPathForRow:1inSection:0];
NSArray *indexArray=[NSArrayarrayWithObject:indexPath_1];
[regTableView reloadRowsAtIndexPaths:indexArraywithRowAnimation:UITableViewRowAnimationAutomatic];
112

被折叠的 条评论
为什么被折叠?



