Objective c 使用presentViewController:animated:completion时,如何将数据传递到显示的视图控制器
使用presentViewController:animated:completion方法时,如何将数据传递给显示的视图控制器?您应该在显示的视图控制器界面中公开属性,并从显示的视图控制器中进行设置Objective c 使用presentViewController:animated:completion时,如何将数据传递到显示的视图控制器,objective-c,uiviewcontroller,Objective C,Uiviewcontroller,使用presentViewController:animated:completion方法时,如何将数据传递给显示的视图控制器?您应该在显示的视图控制器界面中公开属性,并从显示的视图控制器中进行设置 PresentedViewController* presented = [PresentedViewController new]; presented.stringProperty = @"Hello world!" [self presentViewController:presented
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.
}];
我需要在视图之间传递一个字符串。谢谢,这对我帮助很大!