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

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. express + jqPaginator 分页展示内容

    写在前面的话 分页展示内容也是我们在页面开发中经常会遇到的需求 前端页面利用jqPaginator这个jquery插件来编写 后端利用mysql存储数据 开始敲代码 回顾sql知识 首先让我们回顾一下 ...

  2. 路飞学城Python-Day8

    [11.函数-基本介绍]函数引出问题:如果出现这个需求,需要监控单位的服务器状况,当CPU/MEMORY/DISK等指标使用量超过阀值时,就发邮件报警 while True: if CPU利用率> ...

  3. GET,POST请求

    get请求 post请求

  4. UE4自学随笔(一)

    本文及后续均为个人学习记录所用,难免毫无章法零零碎碎,希望看到此文的诸君勿怪. 一.Actor与Pawn Actor类 在UE4中,Actor类是可以放到游戏场景中的游戏对象的基本类型.你如果想放置任 ...

  5. Microsoft Visual Studio 2015打开TFS大量报错问题解决方案

    用vs2015打开项目出现如图错误,尝试对XX项执行 添加 操作时遇到 XX 个错误,因为公司项目比较大,这个错误一直在弹,搜索了下,没有找到出现类似问题的解决方案. 因为这个路径是TFS(Team ...

  6. 洛谷 P1417 烹调方案 (01背包拓展)

    一看到这道题就是01背包 但是我注意到价值和当前的时间有关. 没有想太多,直接写,0分 然后发现输入方式不对-- 改了之后只有25分 我知道wa是因为时间会影响价值,但不知道怎么做. 后来看了题解,发 ...

  7. 错误解决:error: expected ‘;’, ‘,’ or ‘)’ before ‘&’ token

    今天看到一个比较有趣的题目,如下代码,分析输出结果 #include <stdio.h> void num(int &b) { b = 222; return; } int mai ...

  8. 【codeforces 22C】 System Administrator

    [题目链接]:http://codeforces.com/problemset/problem/22/C [题意] 给你n个点; 要求你构造一个含m条边的无向图; 使得任意两点之间都联通; 同时,要求 ...

  9. IP地址的规划和设计方法(二)

    五,IP地址规划方法           (1)IP地址规划的基本步骤           网络地址规划须要按下面6步进行:           a)推断用户对网络与主机数的需求:           ...

  10. Elasticsearch中的CRUD

    在<玩玩儿Elasticsearch>中简介了一下elasticsearch.这篇文章.我们还是做些基础的学习.在Elasticsearch怎样进行CRUD? 如果我们正在创建的一个类似微 ...