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

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. 《Unix环境高级编程》读书笔记 第10章-信号

    1.引言 信号是软件中断. 信号提供了一种处理异步事件的方法. 2. 信号概念 信号的名字都是以3个字符SIG开头. Linux3.2.0支持31种信号.FreeBSD.Linux和Solaris作为 ...

  2. map、栈————下一个更大的元素(待定,栈解法学习中)

    方法一 先遍历nums2,将每个元素后面第一个大的元素一起存入到map中,然后在遍历nums1,在map中找到. class Solution { public: vector<int> ...

  3. 解决vuex刷新页面数据丢失

    1.前言 vue构建的项目中,vuex的状态存储是响应式的,当vue组件从store中读取状态的时候,若store中的状态发生变化,那么相应的组件也会得到高效刷新,问题来了,vuex存储的数据只是在页 ...

  4. UVA-1347 Tour 动态规划 难以确定的状态

    题目链接:https://cn.vjudge.net/problem/UVA-1347 题意 给出按x坐标排序的几个点. 欲从最左边不回头的走到最右边,然后再返回最左边. 每个点都要被访问,且只能经过 ...

  5. 浅谈python 中正则的一些函数

         主要的函数有  : match() search() findall() group() groups() split()  match (): 含义  开头匹配,匹配成功返回一个对象失败则 ...

  6. P1017 进制转换 (负进制转换)

    和平常的转化差不多 加多一步 如果余数 < 0, 那么余数减去除数(此时除数是负),商数加1 #include<cstdio> #define _for(i, a, b) for(i ...

  7. 成都磨子桥技工学校 / 2016届练习区 0003:jubeeeeeat

    0003:jubeeeeeat 总时间限制:  1000ms 内存限制:  256000kB 描述 众所周知,LZF很喜欢打一个叫Jubeat的游戏.这是个音乐游戏,游戏界面是4×4的方阵,会根据音乐 ...

  8. POJ 2516 Minimum Cost (最小费用最大流)

    POJ 2516 Minimum Cost 链接:http://poj.org/problem?id=2516 题意:有M个仓库.N个商人.K种物品.先输入N,M.K.然后输入N行K个数,每一行代表一 ...

  9. springMVC之拦截器

    有两种方法配置spring的拦截器 1. 实现接口: HandleInterceptor public class MyInterceptor1 implements HandlerIntercept ...

  10. 关于fetch

    前言: fetch是用来取代传统的XMLHttpRequest的. 它的优点很多,包括链式调用的语法.返回promise等. 什么是fetch? fetch api是基于promise的设计,它是为了 ...