- (oneway void)release OBJC_ARC_UNAVAILABLE;

今天突然好奇 oneway void 到底是个神马东东,然后就开始查

- (oneway void)release OBJC_ARC_UNAVAILABLE;~~~

把 oneway void 写成 void,就得到了如下的警告:
![屏幕快照 2017-05-23 15.20.40.png](http://upload-images.jianshu.io/upload_images/1084403-d5cf4e1fd2486c3f.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

改回来 - (oneway void)release 之后,警告消失,🍎是这样说的:oneway is used with the distributed objects API, which allows use of objective-c objects between different threads or applications. It tells the system that it should not block the calling thread until the method returns. Without it, the caller will block, even though the method's return type is void. Obviously, it is never used with anything other than void, as doing so would mean the method returns something, but the caller doesn't get it. 
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容