如果我不想在 viewDidLoad() 中创建实例和设置委托但在某些方法中,如何正确定位委托?一切正常,但收到警告。
// ViewController.m
// Warning: Assigning to 'id'<UINavigationControllerDelegate,UIImagePickerControllerDelegate> from incomplatible type 'ViewController *const __strong
-(void)takeMedia:(UIButton *)sender
{
mypicker = [UIImagePickerController new];
mypicker.delegate = self; // <<<----
mypicker.sourceType = UIImagePickerControllerSourceTypeCamera;
[self presentViewController:mypicker animated:YES completion:nil];
}