情况1:界面pop后,调用上一界面的方法
#import "xxxxxx.h" //当前页面
/*
* 修改备注名
*/
- (void)ChangeRemark:(UIButton*)sender {
UIStoryboard *fundSt = [UIStoryboard storyboardWithName:@"Main" bundle:GNNTBUNDLE];
FrameWork_RemarkTableViewController *VC = [fundSt instantiateViewControllerWithIdentifier:@"FrameWork_Remark"];
CommonContactList *list=[_dataArray objectAtIndex:sender.tag];
VC.tag=sender.tag;
VC.receiveAssetUserID=list.oftenUseAssetUserID;
__weak typeof(self) weakSelf = self;
VC.Refrish=^{
[weakSelf.tableView headerBeginRefreshing];
}; //哪个地方push过去的,就在哪个地方写block
[self.navigationController pushViewController:VC animated:YES];
}
typedef void (^BlockRefrish)();
@property (nonatomic, copy) BlockRefrish Refrish;
#improt "FrameWork_RemarkTableViewController.h"
if (resp.result.retCode>= 0) {
[FrameWork_CommonTool showDialogWithMessage:@"修改成功"];
[self.navigationController popViewControllerAnimated:YES];
self.Refrish();
}else{
[FrameWork_CommonTool showDialogWithMessage:resp.result.message];
}
情况2:请求回数据,调用下拉刷新(同一界面)
-(void)viewdidload{
self.BlockHeader=^{
[weakSelf.tableView headerBeginRefreshing];
};
}
-(void)sendMsg{
if (resp.result.retCode>= 0) {
[FrameWork_CommonTool showDialogWithMessage:@"添加成功"];
self.BlockHeader();
}else{
[FrameWork_CommonTool showDialogWithMessage:resp.result.message];
}
}