ios 协议(delegate)使用过程中遇到assign attribute must be unsafeunretained
来源:互联网 发布:类似于whatsapp的软件 编辑:程序博客网 时间:2024/06/02 05:27
今天在使用协议的过程中,偶然发现这样使用
1
2
3
4
5
6
7
8
9
10
@interface
AppDelegate (){
id<chatdelegate> testdelegate;
}
@property
(nonatomic , assign) id<chatdelegate> testdelegate;
@end
@implementation
AppDelegate
@synthesize
testdelegate;
</chatdelegate></chatdelegate>
会报错:
Existing instance variable 'delegate' for property 'delegate' with assign attribute must be unsafe unretained
修改成:
1
2
3
4
5
6
7
8
9
10
@interface
AppDelegate (){
__unsafe_unretained id<chatdelegate> testdelegate;
}
@property
(nonatomic , assign) id<chatdelegate> testdelegate;
@end
@implementation
AppDelegate
@synthesize
testdelegate;
</chatdelegate></chatdelegate>
就好了,这只是为了相容iOS4以下的版本
0 0
- ios 协议(delegate)使用过程中遇到assign attribute must be unsafeunretained
- ios 协议(delegate)使用过程中遇到assign attribute must be unsafeunretained
- error:assign attribute must be unsafeunretained
- iOS中delegate代理对象使用weak和assign哪个?
- iOS中delegate代理对象使用weak和assign哪个
- This attribute must be localized”
- attribute value must be constant
- iOS中delegate(委托)的使用
- 网络访问过程中遇到的java.io.IOException: Target host must not be null的问题
- 网络访问过程中遇到的java.io.IOException: Target host must not be null的问题
- Django 中遇到的问题(1)TypeError: context must be a dict rather than Context.
- Error: This attribute must be localized. 解决方法
- This attribute must be localized错误
- Java - Error: Attribute value must be constant
- Error: This attribute must be localized. 解决方法
- Error: This attribute must be localized. 解决方法
- ButterKnife:Attribute value must be constant
- 『IOS』Property with 'retain (or strong)' attribute must be of object type
- linux下 查看vsftp是否启动状态
- ZOJ 1029 Moving Tables(贪心算法)
- 对任意十个数求和
- 如何使用java类来加载properties配置文件的属性信息
- socekt客户端想socekt服务端发送数据
- ios 协议(delegate)使用过程中遇到assign attribute must be unsafeunretained
- 大数据时代的到来
- 05-树7 堆中的路径
- 两位数与一位数相乘求和
- Android开发系列教程——目录
- C++ 基础杂项
- C# 方法使用 0007
- Python 半自动登录知乎-验证码需要识别
- 关于图的若干问题 很齐全的代码