警告⚠️Assigning to 'id<LoginViewDelegate>' from incompatible type 'LoginViewController *__strong'
2017-03-15 18:32
543 查看
这个问题在设置代理对象的时候出现的,例如,在init方法里有这样的赋值:
self.loginView.delegate = self;
代理对象要给loginView进行代理。警告出现的原因是代理对象,没有实现被代理对象,也就是loginView的代理协议。
可以在实现文件里面这么改:
@interface LoginViewController()<LoginViewDelegate>
当然在头文件里面实现这个协议也OK。anyway,警告消除了。
self.loginView.delegate = self;
代理对象要给loginView进行代理。警告出现的原因是代理对象,没有实现被代理对象,也就是loginView的代理协议。
可以在实现文件里面这么改:
@interface LoginViewController()<LoginViewDelegate>
当然在头文件里面实现这个协议也OK。anyway,警告消除了。
相关文章推荐
- Assigning to ‘id<UIWebViewDelegate>’ from incompatible type 'xxxViewController *const __strong'
- Assigning to 'id<xxxxDelegate>' from incompatible type 'xxxxViewController *const __strong'
- Xcode编译警告Assigning to 'id<XXXDelegat> ——Nullable' from incompatible type 'XXXView *const_strong'
- Assigning to ‘ d<xxxxDelegate>' from incompatible type ‘xxViewController *const __strong'
- Assigning to "id<CALayerDelegate> _Nullable" from incompatible type "ZXCapture *const __strong" 的警告提示信息
- Sending 'ViewController *const __strong' to parameter of incompatible type 'id<***Delegate>'
- Assigning to 'id<QMapViewDelegate>" from incompatible type "view control * const_strong"
- Assigning to 'id<UITextViewDelegate>' from incompatible type 'HBComposeViewController *const __stron
- Sending 'ViewController *const __strong' to parameter of incompatible type 'id<***Delegate>'
- IOS Assigning to 'id<UITabBarControllerDelegate>' from incompatible type...
- Assigning to 'id<UINavigationControllerDelegate,UIImagePickerControllerDelegate>' from incompatible
- Assigning to ‘APPDelegate’ from incompatible type ‘id<UIApplicationDelegate> _Nullable’
- Sending 'ViewController' to Parameter of Incompatible Type 'id<xxxDelegate>'
- Assigning to ‘id<UINavigationControllerDelegate,UIImagePickerControllerDelegate>’ from incompatible
- Assigning to ‘id<UINavigationControllerDelegate,UIImagePickerControllerDelegate>’ from incompatible
- Sending 'xxx *const __strong' to parameter of incompatible type 'id<aDelegate>'
- iOS调试——警告解决办法sending 'viewcontroller *' to parameter of incompatible type 'id UMSocialUIDelegate
- Sending 'AppDelegate *const __strong' to parameter of incompatible type 'id<******Delegate>'
- Assigning to 'AppDelegate *' from incompatible type 'id<UIApplicationDelegate>'
- IOS Assigning to 'id<Delegate>' from incompatible type...解决办法<CALayerDelegate>