Initalizing 'AppDelegate * __strong' with an expression of incompatible type ''id<UIApplicatioinDele
2016-11-23 09:06
931 查看
使用ARC时,获取全局的AppDelegate会有上面的警告。
修改前:
AppDelegate *app = [UIApplication sharedApplication].delegate;
修改后:即(强制转换)
AppDelegate *app = (AppDelegate*)[UIApplication sharedApplication].delegate;
修改前:
AppDelegate *app = [UIApplication sharedApplication].delegate;
修改后:即(强制转换)
AppDelegate *app = (AppDelegate*)[UIApplication sharedApplication].delegate;
相关文章推荐
- Initalizing 'AppDelegate * __strong' with an expression of incompatible type ''id<UIApplicatioinDele
- 警告:Initalizing 'AppDelegate * __strong' with an expression of incompatible type ''id<UIApplication..
- Initializing 'AppDelegate *__strong' with an expression of incompatible type 'id<UIApplicationDelega
- Initializing 'AppDelegate *__strong' with an expression of incompatible type
- Initializing 'Object' *__strong' with an expression of incompatible type 'id <Object> _Nullable
- Sending 'AppDelegate *const __strong' to parameter of incompatible type 'id<******Delegate>'
- Sending 'xxx *const __strong' to parameter of incompatible type 'id<aDelegate>'
- Sending 'ViewController *const __strong' to parameter of incompatible type 'id<***Delegate>'
- 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<CALayerDelegate> _Nullable" from incompatible type "ZXCapture *const __strong" 的警告提示信息
- Assigning to ‘ d<xxxxDelegate>' from incompatible type ‘xxViewController *const __strong'
- The value of attribute "title" associated with an element type "question" must not contain the '<' c
- Sending 'ViewController' to Parameter of Incompatible Type 'id<xxxDelegate>'
- Assigning to 'id<xxxxDelegate>' from incompatible type 'xxxxViewController *const __strong'
- The value of attribute "description" associated with an element type "target" must not contain the '<' character.
- Assigning to 'AppDelegate *' from incompatible type 'id<UIApplicationDelegate>'
- Assigning to ‘id<UIWebViewDelegate>’ from incompatible type 'xxxViewController *const __strong'
- <java>No enclosing instance of type GraphicFrame is accessible. Must qualify the allocation with an
- 警告⚠️Assigning to 'id<LoginViewDelegate>' from incompatible type 'LoginViewController *__strong'