1. 程式人生 > >FMDB源碼閱讀(一)FMDatabase

FMDB源碼閱讀(一)FMDatabase

data database efi tomat cnblogs ref details color retain

 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