三个通知方:
第一个
NSDictionary *dic = @{@"title":TextField.text,@"typeID":@(1)};
[[NSNotificationCenter defaultCenter] postNotificationName:@"noti" object:nil userInfo:dic];
第二个
NSDictionary *dic = @{@"title":textArr[indexPath.row],@"typeID":@(2)};
[[NSNotificationCenter defaultCenter] postNotificationName:@"noti" object:nil userInfo:dic];
第三个
NSDictionary *dic = @{@"title":TextField.text,@"typeID":@(3)};
[[NSNotificationCenter defaultCenter] postNotificationName:@"noti" object:nil userInfo:dic];
接收方
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(noti:) name:@"noti" object:nil];
-(void)noti:(NSNotification *)noti {
NSDictionary *dic = [noti userInfo];
NSString * title = dic[@"title"];
if ([dic[@"typeID"] integerValue]==1) {
//Name
_nichengString = title;
}
if ([dic[@"typeID"] integerValue]==2) {
//GongSi
_gongsiString2 = title;
}
if ([dic[@"typeID"] integerValue]==3) {
//nicheng
_xingmingString = title;
}
//刷新表格
[_tbv reloadData];
}