我添加了UIImagePickerController一个UIViewController.我也指定了UIImagePickerControllerDelegate那个UIViewController.
当我执行以下行时,
myPicker.delegate = self;
Run Code Online (Sandbox Code Playgroud)
Xcode通过以下消息告诉我:
警告:从不兼容的类型'RootViewController'分配id
然后我将UINavigationControllerDelegate协议添加到同一个UIViewController并且错误消息消失了.
所以,我必须双方协议添加到UIViewController时候我加入UIImagePickerController?
如果它UIImagePickerController是UINavigationController文档中所述的子类,那么这不应该是自动的吗?为什么我必须添加其父代理协议而不仅仅是UIImagePickerControllerDelegate协议?
这是一个错误还是我错过了什么?
iphone inheritance delegates uiimagepickercontroller uinavigationcontroller