标签:
今天在使用协议的过程中,偶然发现这样使用
@interface AppDelegate (){
id<ChatDelegate> testdelegate;
}
@property (nonatomic , assign) id<ChatDelegate> testdelegate;
@end
@implementation AppDelegate
@synthesize testdelegate;
Existing instance variable ‘delegate‘ for property ‘delegate‘ with assign attribute must be unsafe unretained
修改成:
@interface AppDelegate (){
__unsafe_unretained id<ChatDelegate> testdelegate;
}
@property (nonatomic , assign) id<ChatDelegate> testdelegate;
@end
@implementation AppDelegate
@synthesize testdelegate;
参考:http://www.cnblogs.com/lyanet/archive/2013/05/07/3064290.html
ios 协议(delegate)使用过程中遇到assign attribute must be unsafeunretained
标签:
原文地址:http://blog.csdn.net/lv_ruanruan/article/details/44751147