使用 presentViewController:animated:completion 方法时,如何将数据传递给呈现的 View Controller?
问问题
315 次
1 回答
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.
}];
于 2013-10-18T02:54:32.680 回答