为什么我们需要在 iPhone 的 ImagePickerController 中实现 UiNavigationcontroller delegate

发布于 2024-09-14 19:57:53 字数 390 浏览 3 评论 0原文

大家好,我正在使用 Uiimagepickercontroller 录制视频,我需要实现两个委托。1 是 UINavigationcontroller 委托,2 是 UIImagepickercontroller 委托。如果我们不使用 navigationcontroller 委托,它会在代码中发出警告 picker.delegte=self;

UINavigationControllerDelegate 的必要性是什么.. 我的要求是我自动录制视频..所以在停止录制后,它应该转到屏幕上说 useThis ,放弃选项,然后播放捕获的视频?

有什么办法..可以做到这一点.. 谁能告诉我这个方法以及 UINavigtaioncontrollerdelegate 到底是什么?

谢谢大家

hello all I am using Uiimagepickercontroller to record a video there I need to implement two delegates.. 1 is UINavigationcontroller delegate and 2 is UIImagepickercontroller delegate.If we not use navigationcontroller delegate its giving me warning at the code picker.delegte=self;

what is the necessity of UINavigationControllerDelegate..
My requirement is I am recording a vedio automatically.. so after it stops recording It should go to the Screen saying that useThis ,Discard options and it plays the video what is captured?

Is there any way.. to do that ..
could any one tell me the way for this and what is the UINavigtaioncontrollerdelegate exactly?

Thank you all

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不美如何 2024-09-21 19:57:53

UIImagePickerController 是 UINavigationController 的子类。它要求其委托实现 UIImagePickerControllerDelegate 协议,同时仍为其超类实现 UINavigationControllerDelegate 协议。

这意味着您需要像这样声明委托类:

@interface MyDelegate : NSObject <UIImagePickerControllerDelegate,
                                  UINavigationControllerDelegate>

然后实现两个协议所需的方法。

UIImagePickerController is a subclass of UINavigationController. It requires its delegate to implement the UIImagePickerControllerDelegate protocol while still implementing the UINavigationControllerDelegate protocol for its superclass.

That means you need to declare your delegate class like this:

@interface MyDelegate : NSObject <UIImagePickerControllerDelegate,
                                  UINavigationControllerDelegate>

And then implement the required methods for both protocols.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文