今天在使用协议的过程中。偶然发现这样使用

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 beunsafe 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下面的版本号

error:assign attribute must be unsafeunretained的更多相关文章

  1. non-ARC代码转 ARC 排除 “Existing instance variable 'delegate' for property with assign attribute must be _unsafe _unretained” 错误

    原来非ARC代码是 @interface MHWebImageDownloader : NSObject { id<MHWebImageDownloaderDelegate> delega ...

  2. android在style中使用自定义属性 error: style attribute not found.

    异常: Error:(128, 5) error: style attribute 'com.honghui0531.prebiotics.view:attr/item_right_icon_src' ...

  3. error: style attribute '@android:attr/windowEnterAnimation' not found.

    在Project/gradle.properties中添加 android.enableAapt2=false

  4. Android Error: This attribute must be localized.

    在android中使用mmm命令编译程序是出现错误. 这种问题一般情况是因为在res/xml文件夹下的中, 或者在res/layout下的文件中出现了没有多语言话的文本例. 解决方法: 不直接在布局文 ...

  5. System Error Codes

    很明显,以下的文字来自微软MSDN 链接http://msdn.microsoft.com/en-us/library/windows/desktop/ms681382(v=vs.85).aspx M ...

  6. winerror.h中的内容(可以查看last error对应)

    /************************************************************************* ** winerror.h -- error co ...

  7. ios中strong, weak, assign, copy

    copy 和 strong(retain) 区别 1. http://blog.csdn.net/itianyi/article/details/9018567 大部分的时候NSString的属性都是 ...

  8. 使用POI解析Excel时,出现org.xml.sax.SAXParseException: duplicate attribute 'o:relid'的解决办法

    1.使用org.apache.poi解析excle,.xlsx类型文件InputStream is = new FileInputStream(strFileName);XSSFWorkbook wb ...

  9. Windows Error Codes

    http://www.briandunning.com/error-codes/?source=Windows Windows Error Codes List All Error Codes | S ...

随机推荐

  1. 关于深度残差网络(Deep residual network, ResNet)

    题外话: From <白话深度学习与TensorFlow> 深度残差网络: 深度残差网络的设计就是为了克服这种由于网络深度加深而产生的学习效率变低,准确率无法有效提升的问题(也称为网络退化 ...

  2. 解决com.mysql.jdbc.PacketTooBigException: Packet for query is too large问题

    2017年05月10日 09:45:55 阅读数:1659 在做查询数据库操作时,报了以上错误,原因是MySQL的max_allowed_packet设置过小引起的,我一开始设置的是1M,后来改为了2 ...

  3. 5、AFM(Attention+FM)-----Attentional Factorization Machines:Learning the Weight of Feature Interactions via Attention Network

    1.摘要: 提出一个Attentional FM,Attention模型+因子分解机,其通过Attention学习到特征交叉的权重.因为很显然不是所有的二阶特征交互的重要性都是一样的,如何通过机器自动 ...

  4. 51nod 1321 收集点心(最小割)

    给出一种最小割的方法. 设\(num1[i]\),\(num2[i]\)为第i种形状的点心的两种口味的数量 设\(type[i]\),\(type[i]\)为第i种形状的点心的两种口味 假设\(num ...

  5. 使用systemctl自定义系统服务

    1.创建系统服务文件,格式如下: [Unit] Description=httpd After=network.target [Service] Type=forking ExecStart=/usr ...

  6. deque迭代器失效的困惑?

    在实现LRU算法的时候lru_list 開始用的是deque 可是由于害怕其在插入删除上的迭代器失效情况的诡异情况.遂用list取代之. 在数据量比較大的时候性能不是非常好.性能优化分析的时候决定用d ...

  7. iOS gzip解压

    1. 导入libz库(如:libz 1.2.5.dylib) 2. 引入头文件 #import "zlib.h" 3. 实现解压(输入输出都为NSData对象) -(NSData ...

  8. CodeForces 550B Preparing Olympiad(DFS回溯+暴力枚举)

    [题目链接]:click here~~ [题目大意] 一组题目的数目(n<=15),每一个题目有对应的难度,问你选择一定的题目(大于r个且小于l个)且选择后的题目里最小难度与最大难度差不小于x, ...

  9. pig 调试(explain&amp;illerstrate)

    grunt> cat t.txt kw1 2 kw3 1 kw2 4 kw1 5 kw2 2 cat test.pig A = LOAD '/user/input/t.txt' as (k:ch ...

  10. [CQOI2009] 叶子的颜色 解题报告(树形DP)

    题目链接:https://www.lydsy.com/JudgeOnline/problem.php?id=1304 Description 给一棵m个结点的无根树,你可以选择一个度数大于1的结点作为 ...