我想将数据从ParcelResultViewController发送到ViewController(Main),但我没有ParcelResultViewController和viewcontroller之间的连接segue。我分享了我的故事板图像和代码块。
如何处理这种情况?
ParcelResultViewController.m
if (nil == self.viewcontroller) {
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]];
self.viewcontroller = [storyboard instantiateViewControllerWithIdentifier:@"ViewController"];
self.viewcontroller.fieldAliases = self.gonderilenFeatureSet.fieldAliases;
self.viewcontroller.displayFieldName = self.gonderilenFeatureSet.displayFieldName;
NSLog(@"%@",[self.gonderilenFeatureSet.features objectAtIndex:indexPath.row]);
}
//the details view controller needs to know about the selected feature to get its value
self.viewcontroller.feature = [self.gonderilenFeatureSet.features objectAtIndex:indexPath.row];
答案 0 :(得分:2)
从解析控制器发送通知,并将数据作为对象。
使用NSNotificationCenter
执行此操作。