很多时候,在使用Automatic Reference Counting的是时候,会提示一些很陌生的的错误提示,特别是使用conver to arc后,
比如bridged cast
给你的c代码上面加个_bridged。
这里面有个详细的描述,
A bridged cast is a C-style cast annotated with one of three keywords:
-
(__bridge T) op casts the operand to the destination type T. If T is a retainable object pointer type, then op must have a non-retainable pointer type. If T is a non-retainable pointer type, then op must have a retainable object pointer type. Otherwise the cast is ill-formed. There is no transfer of ownership, and ARC inserts no retain operations.
-
(__bridge_retained T) op casts the operand, which must have retainable object pointer type, to the destination type, which must be a non-retainable pointer type. ARC retains the value, subject to the usual optimizations on local values, and the recipient is responsible for balancing that +1.
-
(__bridge_transfer T) op casts the operand, which must have non-retainable pointer type, to the destination type, which must be a retainable object pointer type. ARC will release the value at the end of the enclosing full-expression, subject to the usual optimizations on local values.
These casts are required in order to transfer objects in and out of ARC control; see the rationale in the section on conversion of retainable object pointers.
Using a __bridge_retained or __bridge_transfer cast purely to convince ARC to emit an unbalanced retain or release, respectively, is poor form.
其实,你在apple llvm 的提示下面应该就能看到一些消息的描述,主要是说retain,这里面的bridge有unretained 和retained两种,说到这里面大家应该知道retain的含义了。
先写到这。
其实在这里面,跟多的是一些警告,让我决定很烦。
比如隐式转换,和显示转换。
分享到:
相关推荐
\ArcEngine开发——在64位操作系统下使用VS2010中开发ArcEngine应用程序的编译问题.
用C语言实现ARC圆弧插补计算,有用得到的朋友可以试试
采用优化的单片机查表法计算atan角度的方法,重点解决了几个问题: (1)且用asin曲线计算代替难以描述的atan曲线,快速开方函数 (2)全部采用整形运算,加快了运算速度,返回的角度范围是0~360.00,包含4个象限...
中英文转ARC2码编码软件,可将使用的中英文编译为ARC2码供单片机编程使用。
从这里可以知道一些关于Xcode的内存管理,ARC模式下的内存管理
arc 架构risc 编译手册,详细的编译器说明以及c语言特定语法要求
在arcengine的scenecontrol中使用Opengl
我们的软件是使用ArcEngine来开发的,在网上输入关键字“arcengine 距离测量”,可以搜索到一大堆内容基本相似的文章或代码,基本上都是采用INewLineFeedback来实现的,我们的软件也是使用此种方法。方法大致如下:...
对于ALLEGRO设计在出验证光绘文件阶段,在CAM350中导入光绘文件时经常有报错"Zero radius arc detected.Assuming linear interpolation",导致无法正常导入光绘文件。解决这个问题我是半猜半蒙,发生过几次这个问题,...
呵呵,本人自己做的arcengine9.2软件开发包帮助文档使用视频,适合初级入门者,不懂得如和使用英文帮助文档的。 先唠叨两句自己的心得体会:在开始学习的时候不要有畏惧感觉,一看到英文帮助文档,好家伙,那么庞大...
ArcEngine开时使用Arcgis自带的一些命令
arc_conv========Command-line visual novel toolkit written by w8m in pure ASM
7. ArcEngine中使用上下左右键移动地图功能的实现 15 8. 缓冲区的创建 16 9. C#制作鹰眼全过程(引自ESRI中国社区) 18 10. ArcEngine中拓扑的使用- - 20 11. 为什么使用接口编程{转载} 23 12. ArcEngine中闪烁目标 26...
zip包文件里是一个xcode工程,里面有ARC和非ARC模版宏定义和使用例子,
如何在ArcEngine与ArcServer开开发过程中使用postgresql
ARC STM32 使用手册,包括很多实例说明
ArcHydro中文操作手册,本手册的目的是一步一步阐明怎样安装ArcHydro以及怎样使用工具集提供的主要功能。
arcengine中文开发文档
AVL树的C语言实现
iOS 5 ARC完全指南中文 ...iOS 4 中使用ARC 27 ARC 高级指南 28 Blocks 与ARC 28 Singleton 与ARC 34 Autorelease 和AutoreleasePool 40 Cocos2D 和 Box2D 45 静态库static library 48 最后? 49 参考资料 49