iOS强弱引用宏
来源:互联网 发布:扫地机器人算法 编辑:程序博客网 时间:2024/06/03 02:42
弱引用:
#ifndef weakify
#if DEBUG
#if __has_feature(objc_arc)
#define weakify(object) autoreleasepool{} __weak __typeof__(object) weak##_##object = object;
#else
#define weakify(object) autoreleasepool{} __block __typeof__(object) block##_##object = object;
#endif
#else
#if __has_feature(objc_arc)
#define weakify(object) try{} @finally{} {} __weak __typeof__(object) weak##_##object = object;
#else
#define weakify(object) try{} @finally{} {} __block __typeof__(object) block##_##object = object;
#endif
#endif
#endif
强引用:
#ifndef strongify
#if DEBUG
#if __has_feature(objc_arc)
#define strongify(object) autoreleasepool{} __typeof__(object) object = weak##_##object;
#else
#define strongify(object) autoreleasepool{} __typeof__(object) object = block##_##object;
#endif
#else
#if __has_feature(objc_arc)
#define strongify(object) try{} @finally{} __typeof__(object) object = weak##_##object;
#else
#define strongify(object) try{} @finally{} __typeof__(object) object = block##_##object;
#endif
#endif
#endif
- iOS强弱引用宏
- IOS 强弱引用
- iOS强弱引用
- iOS 强弱引用
- iOS之解决强弱循环引用的宏
- iOS block嵌套强弱引用转换 --心得
- C语言 强弱符号,强弱引用
- 关于oc中的强弱引用
- Android中的强弱引用计数(强弱指针)
- Swift入门教程17-ARC与强弱引用
- 关于block的强弱引用问题
- Java强弱软虚引用概述
- Android的引用计数(强弱指针)技术及一些问题
- 关于强弱引用的问题 strong,weak,assign
- Java的4种引用,强弱软虚
- Java的四种引用之强弱软虚
- ios开发点滴-信号强弱检测方法
- 【代码笔记】iOS-自定义选择框(高底强弱)
- 个人总结3
- 004Median of Two Sorted Arrays (C)
- Git 解决Bug:fatal: Could not read from remote repository ——诺诺"涂鸦"记忆
- 设计模式-组合模式
- 3.大神班 scrollView 与 动画 imageView的加载图片
- iOS强弱引用宏
- 手把手教你使用Git--初学者的好福利
- 通往全栈工程师的捷径 —— react
- Masonry教程--IOS自适配
- Web开发&文件上传下载及编码解码
- 设计模式-外观模式
- Terminating app due to uncaught exception unrecognized selector sent to instance程序崩毁后如何快速定位哪一行错误
- Android按菜单键闪退问题
- iOS Newbie - Xcode 7 & iOS 9 Navigation Bar & Status Bar