浏览代码

Merge pull request #201 from NachoSoto/master

Overriding the parent class designated initializer
August "Gus" Mueller 12 年之前
父节点
当前提交
e70cd055a6
共有 3 个文件被更改,包括 14 次插入0 次删除
  1. 4 0
      src/FMDatabase.m
  2. 4 0
      src/FMDatabasePool.m
  3. 6 0
      src/FMDatabaseQueue.m

+ 4 - 0
src/FMDatabase.m

@@ -29,6 +29,10 @@ + (BOOL)isSQLiteThreadSafe {
     return sqlite3_threadsafe() != 0;
 }
 
+- (instancetype)init {
+    return [self initWithPath:nil];
+}
+
 - (instancetype)initWithPath:(NSString*)aPath {
     
     assert(sqlite3_threadsafe()); // whoa there big boy- gotta make sure sqlite it happy with what we're going to do.

+ 4 - 0
src/FMDatabasePool.m

@@ -27,6 +27,10 @@ + (instancetype)databasePoolWithPath:(NSString*)aPath {
     return FMDBReturnAutoreleased([[self alloc] initWithPath:aPath]);
 }
 
+- (instancetype)init {
+    return [self initWithPath:nil];
+}
+
 - (instancetype)initWithPath:(NSString*)aPath {
     
     self = [super init];

+ 6 - 0
src/FMDatabaseQueue.m

@@ -40,6 +40,7 @@ + (instancetype)databaseQueueWithPath:(NSString*)aPath flags:(int)openFlags {
     return q;
 }
 
+
 - (instancetype)initWithPath:(NSString*)aPath flags:(int)openFlags {
     
     self = [super init];
@@ -74,6 +75,11 @@ - (instancetype)initWithPath:(NSString*)aPath {
     return [self initWithPath:aPath flags:SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE];
 }
 
+- (instancetype)init {
+    return [self initWithPath:nil];
+}
+
+    
 - (void)dealloc {
     
     FMDBRelease(_db);