Initializing 'AppDelegate *__strong' with an expression of incompatible type
来源:互联网 发布:c语言标准函数库百度云 编辑:程序博客网 时间:2024/05/25 01:34
使用ARC时,获取全局的AppDelegate会有上面的警告。
修改前:
AppDelegate *app = [UIApplicationsharedApplication].delegate;
修改后:即(强制转换)
AppDelegate *app = (AppDelegate*)[UIApplicationsharedApplication].delegate;
0 0
- 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
- Initalizing 'AppDelegate * __strong' with an expression of incompatible type ''id<UIApplicatioinDele
- 警告:Initalizing 'AppDelegate * __strong' with an expression of incompatible type ''id<UIApplication..
- Initalizing 'AppDelegate * __strong' with an expression of incompatible type ''id<UIApplicatioinDele
- Sending 'AppDelegate *const __strong' to parameter of incompatible type 'id<******Delegate>'
- Sending 'ViewController *const __strong' to parameter of incompatible type 'id<***Delegate>'
- Sending 'ViewController *const __strong' to parameter of incompatible type 'id<***Delegate>'
- Sending 'NSProgress *__strong *' to parameter of incompatible type 'void (^ _Nullable)(NSProgress *
- Sending 'xxx *const __strong' to parameter of incompatible type 'id<aDelegate>'
- Assigning to ‘id<UIWebViewDelegate>’ from incompatible type 'xxxViewController *const __strong'
- Assigning to ‘ d<xxxxDelegate>' from incompatible type ‘xxViewController *const __strong'
- Assigning to 'id<xxxxDelegate>' from incompatible type 'xxxxViewController *const __strong'
- illegal use of this type as an expression 解决方案
- error C2275! illegal use of this type as an expression
- 'PIO_STACK_LOCATION' : illegal use of this type as an expression
- illegal use of this type as an expression
- SpringMVC + JDBC + POI Excel导出与导入 +下载 资源
- HPUNIX环境常用查看硬件设备信息命令小结
- GitHub 最受欢迎深度学习应用项目 Top 16
- react native 实战[商城DEMO]
- 初识Python
- Initializing 'AppDelegate *__strong' with an expression of incompatible type
- C++ primer 二十一 模板
- HDOJ 5621-KK's Point【几何】
- Android6.0 亮屏灭屏流程(DisplayPowerControler、WMS)(二)亮度设置
- java web and vue.js 配合使用---servlet的配置
- STM32之FLASH操作
- git仓库的创建与添加文件
- rxjava+retrofit简单demo
- BigDecimal的用法