FMDB源码阅读FMDatabase
Posted CHM
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了FMDB源码阅读FMDatabase相关的知识,希望对你有一定的参考价值。
FMDatabase.h
1 #if ! __has_feature(objc_arc) 2 #define FMDBAutorelease(__v) ([__v autorelease]); 3 #define FMDBReturnAutoreleased FMDBAutorelease 4 5 #define FMDBRetain(__v) ([__v retain]); 6 #define FMDBReturnRetained FMDBRetain 7 8 #define FMDBRelease(__v) ([__v release]); 9 10 #define FMDBDispatchQueueRelease(__v) (dispatch_release(__v)); 11 #else 12 // -fobjc-arc 13 #define FMDBAutorelease(__v) 14 #define FMDBReturnAutoreleased(__v) (__v) 15 16 #define FMDBRetain(__v) 17 #define FMDBReturnRetained(__v) (__v) 18 19 #define FMDBRelease(__v) 20 21 // If OS_OBJECT_USE_OBJC=1, then the dispatch objects will be treated like ObjC objects 22 // and will participate in ARC. 23 // See the section on "Dispatch Queues and Automatic Reference Counting" in "Grand Central Dispatch (GCD) Reference" for details. 24 #if OS_OBJECT_USE_OBJC 25 #define FMDBDispatchQueueRelease(__v) 26 #else 27 #define FMDBDispatchQueueRelease(__v) (dispatch_release(__v)); 28 #endif 29 #endif
这里的预编译主要是 FMDB 用来兼容 ARC 和 MRC 的。
以上是关于FMDB源码阅读FMDatabase的主要内容,如果未能解决你的问题,请参考以下文章