使用presentViewController时:animated:completion方法如何将数据传递给呈现的View Controller?
答案 0 :(得分:0)
您应该在呈现的视图控制器界面中公开属性,并从呈现视图控制器中设置它们。
PresentedViewController* presented = [PresentedViewController new];
presented.stringProperty = @"Hello world!"
[self presentViewController:presented animated:YES completion:^ {
presented.anotherStringProperty = @"Hello again, world!"; //Set here if you need to pass the value after presentation.
}];