objective-c - iOS9.3 __weak reference
怪我咯
怪我咯 2017-05-02 09:22:06
[iOS讨论组]

1.升级xcode 7.3 后 会导致;
2.问题:cannot create __weak reference in file using manual reference counting

__cpt_weak UIPinchGestureRecognizer *pinchGestureRecognizer;

怪我咯
怪我咯

走同样的路,发现不同的人生

全部回复(1)
淡淡烟草味

可以设置build setting -> Apple LLVM7.1 - Language - Objective C -> Weak References in Manual Retain Release YES

或者用__unsafe_unretained 代替__weak,但是如果用__unsafe_unretained请注意下面的问题。

__unsafe_unretained specifies a reference that does not keep the referenced object alive and is not set to nil when there are no strong references to the object. If the object it references is deallocated, the pointer is left dangling.

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号