彻底解决:@synthesize of 'weak' property is only allowed in ARC or GC mode :问题
来源:互联网 发布:java编程面试题 编辑:程序博客网 时间:2024/05/22 22:49
现在的项目是手动内存管理,所以在引入第三方资源库时候,很多资源库更新以后都开始使用arc进行编码,这样就导致两种代码风格不一致,有的时候可能开发者也没有注意到这些问题,反正用的时候也没有报错,就直接使用了;但是有的时候,因为arc编码中用到了新的属性修饰符,例如weak,这时候在手动管理内存的代码中就不能编译通过,报错的内容就是:@synthesize of ‘weak’ property is only allowed in ARC or GC mode,这就是引入的arc代码在项目中的冲突,有一种解决办法就是把资源代码中的weak修饰符改为assign,但是这种方法毕竟是把别人写的代码给改了,有的时候往往会出现闪退、崩溃的问题。
比较好的解决办法就是项目配置文件->Build Phrases->Complie Sources,找到出现问题的资源库文件(比如weak修饰符所在的文件),双击Complie Files中的该文件,在空白行中写入-fobjc-arc,这样就可以有效防止该冲突。反过来有的时候,在arc代码中引入手动管理内存的代码,我们在Complie Files中为新增的资源文件增加-fno-objc-arc,这样就避免了手动管理内存的代码在arc代码中的冲突。
0 0
- 彻底解决:@synthesize of 'weak' property is only allowed in ARC or GC mode :问题
- @synthesize of 'weak' property is only allowed in ARC or GC mode
- 12、@synthesize of ‘weak’ property is only allowed in ARC or GC mode
- @synthesize of 'weak' property is only allowed in ARC or GC mode
- @synthesize of 'weak' property is only allowed in ARC or GC mode
- 使用第三方框架的时候报“synthesize of ‘weak’ property is only allowed in ARC or GC mode”错
- 新技能get,在ios下提示“@synthesize of ‘weak’ property is only allowed in ARC or GC mode”
- synthesis-of-weak-property-only-allowed-in-arc-or-gc-mode ARC属性
- iOS开发中的 @synthesize of 'weak' property is only allowed in
- Dev-c++ [Error] 'for' loop initial declarations are only allowed in C99 or C11 mode
- IBOutlet property is strong or weak
- 编译器问题,error: 'for' loop initial declarations are only allowed in C99 mode
- OpenSessionInViewFilter与Write operations are not allowed in read-only mode 独门问题解决之道
- SSH整合问题:Write operations are not allowed in read-only mode
- Write operations are not allowed in read-only mode (FlushMode.NEVER) - turn your Session into FlushMode.AUTO or remove 'readOnly
- Write operations are not allowed in read-only mode (FlushMode.NEVER) - turn your Session into FlushMode.AUTO or remove 'readOnly
- Write operations are not allowed in read-only mode (FlushMode.NEVER) - turn your Session into FlushMode.AUTO or remove 'readOnly
- Write operations are not allowed in read-only mode (FlushMode.NEVER) - turn your Session into FlushMode.AUTO or remove 'readOnly
- Mybatis3源码分析(三):解析mapper的xml配置文件
- 华为光猫破解日记
- 54,对象的存储细节
- 在CentOS 7.0中配置svn自动更新出现的问题
- 彻底解决_OBJC_CLASS_$_某文件名", referenced from:问题
- 彻底解决:@synthesize of 'weak' property is only allowed in ARC or GC mode :问题
- 55,成员变量,全局变量与局部变量的区别
- 56,函数与方法的区别
- ubuntu sogou输入法安装及设置
- Android四大组件简介
- rtcp字段计算方法
- pc,lr相互作用
- Xshell 配色方案
- Mac OS X 启用超级用户 sudo -s 获得系统权限 Mac终端命令