警告:Initalizing 'AppDelegate * __strong' with an expression of incompatible type ''id<UIApplication..
来源:互联网 发布:手机淘宝没有一元抢购 编辑:程序博客网 时间:2024/05/19 00:09
现象:使用ARC时,获取全局的AppDelegate会有警告Initalizing 'AppDelegate * __strong' with an expression of incompatible type ''id<UIApplicationDelegate>"。
原因:类型不一致
解决办法:强制类型转换
实例:
修改前:
AppDelegate *app = [UIApplication sharedApplication].delegate;
修改后:即(强制转换)
AppDelegate *app = (AppDelegate*)[UIApplication sharedApplication].delegate;
0 0
- 警告:Initalizing 'AppDelegate * __strong' with an expression of incompatible type ''id<UIApplication..
- Initalizing 'AppDelegate * __strong' with an expression of incompatible type ''id<UIApplicatioinDele
- Initalizing 'AppDelegate * __strong' with an expression of incompatible type ''id<UIApplicatioinDele
- Initializing 'AppDelegate *__strong' with an expression of incompatible type
- Initializing 'AppDelegate *__strong' with an expression of incompatible type 'id<UIApplicationDelega
- Initializing 'Object' *__strong' with an expression of incompatible type 'id <Object> _Nullable
- AppDelegate警告 Initalizing 'AppDelegate * __strong'
- Sending 'AppDelegate *const __strong' to parameter of incompatible type 'id<******Delegate>'
- 警告⚠️Assigning to 'id<LoginViewDelegate>' from incompatible type 'LoginViewController *__strong'
- Sending 'ViewController *const __strong' to parameter of incompatible type 'id<***Delegate>'
- Sending 'ViewController *const __strong' to parameter of incompatible type 'id<***Delegate>'
- Sending 'xxx *const __strong' to parameter of incompatible type 'id<aDelegate>'
- Assigning to ‘id<UIWebViewDelegate>’ from incompatible type 'xxxViewController *const __strong'
- Assigning to 'id<xxxxDelegate>' from incompatible type 'xxxxViewController *const __strong'
- Assigning to 'AppDelegate *' from incompatible type 'id<UIApplicationDelegate>'
- Assigning to ‘APPDelegate’ from incompatible type ‘id<UIApplicationDelegate> _Nullable’
- 警告解决办法sending 'viewcontroller *' to parameter of incompatible type 'id UMSocialUIDelegate
- Sending 'NSProgress *__strong *' to parameter of incompatible type 'void (^ _Nullable)(NSProgress *
- IOS编程第四版第二章---Managing Memory with ARC
- CAS单点登录项目实战(1)
- 大数求余
- 运维浅谈:mysql优化
- GRE填空备考的三点建议
- 警告:Initalizing 'AppDelegate * __strong' with an expression of incompatible type ''id<UIApplication..
- AJAJX 使用JSON传递参数
- object-c 全屏播放时动态添加slider
- 批量将网页转换成图片或PDF文档技巧分享
- iOS 核心动画合成
- LeetCode_Linked List_Remove Duplicates from Sorted List
- android 使用LayoutInflater使得listview变模糊
- 系统运行出错求帮忙
- python 的一些特性