我有一个带有 UIView 和一个按钮的视图。按下按钮会弹出一个 ModalViewController,它是 UIView,里面有 UITextField。我需要将 UIView 中 NSObject 的字符串值作为字符串传递给 ModalViewController。在按钮点击我称之为:
-(void) editNote{
TextViewController * vc = [(TextViewController *)[TextViewController alloc] init];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:vc];
[self.navigationController presentModalViewController:nav animated:YES];
[vc release];
}
通常,在行选择时,我们使用 pushviewcontroller 将数据推送到下一个视图,但是在做了很多谷歌之后,我无法弄清楚如何使用 presentmodalviewcontroller 传递数据。