如何在iPhone/iPad中使用presentModalViewController?
大家好,我是 iPhone/iPad 开发领域的新手。
在我的应用程序中,单击按钮想要显示像presentModalViewController这样的视图控制器,我能够做到这一点,其中包含带有一些值的UITableView。在选择颗粒行时,我想将值传递给该控制器后面的控制器。
为此,我正在使用苹果示例应用程序 PhotoPicker 代码。 http://developer.apple.com/library/ios/ #samplecode/PhotoPicker/Introduction/Intro.html
但我无法理解我在代码中做错了什么。
我无法进入 MyViewController.m 中的代码,
- (void)didFinishWithCamera
{
[self dismissModalViewControllerAnimated:YES];
//Here is my some logic
}
任何人都可以帮助我...如何从 OverlayViewController 调用此函数?
请参考上面的链接并指导我或给我一些步骤或指导我同样的事情。
Hi i am very new in iPhone/iPad developmet.
In my application on clicking of button in want to show view controller like presentModalViewController and i am able to do that which contains the UITableView with some numbers of values. on selecting particulate row i want to pass values to controller which is behind that controller.
for that i am using apple sample application PhotoPicker code. http://developer.apple.com/library/ios/#samplecode/PhotoPicker/Introduction/Intro.html
But i am not able to understand the what i did wrong in my code.
I am not able to go in the code which is in the MyViewController.m
- (void)didFinishWithCamera
{
[self dismissModalViewControllerAnimated:YES];
//Here is my some logic
}
can any one help me for this...how to call this function from OverlayViewController?
please refer above link and guide me or give me some steps or guide me for the same.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用委托。
我在我目前正在编写的应用程序中使用类似的东西:
use delegation.
I use something like this in a app I'm writing at the moment:
您还可以使用 NSNotificationCenter 来完成此操作。
MyViewController.m 内部:
来自 OverlayViewController.m:
使用上面的类方法从 OverlayViewController 调用 MyViewController 中的 didFinishWithCamera
You can also do this with use of NSNotificationCenter.
Inside MyViewController.m:
From OverlayViewController.m:
Use the above class method to call didFinishWithCamera in MyViewController from OverlayViewController