Browse Source

Merge pull request #156 from antons/master

Changed return type of constructors from id to instancetype
August "Gus" Mueller 12 năm trước cách đây
mục cha
commit
addc7b5351

+ 2 - 2
src/FMDatabase.h

@@ -149,7 +149,7 @@
 
  */
 
-+ (id)databaseWithPath:(NSString*)inPath;
++ (instancetype)databaseWithPath:(NSString*)inPath;
 
 /** Initialize a `FMDatabase` object.
  
@@ -177,7 +177,7 @@
 
  */
 
-- (id)initWithPath:(NSString*)inPath;
+- (instancetype)initWithPath:(NSString*)inPath;
 
 
 ///-----------------------------------

+ 2 - 2
src/FMDatabase.m

@@ -16,7 +16,7 @@ @implementation FMDatabase
 @synthesize checkedOut=_checkedOut;
 @synthesize traceExecution=_traceExecution;
 
-+ (id)databaseWithPath:(NSString*)aPath {
++ (instancetype)databaseWithPath:(NSString*)aPath {
     return FMDBReturnAutoreleased([[self alloc] initWithPath:aPath]);
 }
 
@@ -29,7 +29,7 @@ + (BOOL)isSQLiteThreadSafe {
     return sqlite3_threadsafe() != 0;
 }
 
-- (id)initWithPath:(NSString*)aPath {
+- (instancetype)initWithPath:(NSString*)aPath {
     
     assert(sqlite3_threadsafe()); // whoa there big boy- gotta make sure sqlite it happy with what we're going to do.
     

+ 2 - 2
src/FMDatabasePool.h

@@ -57,7 +57,7 @@
  @return The `FMDatabasePool` object. `nil` on error.
  */
 
-+ (id)databasePoolWithPath:(NSString*)aPath;
++ (instancetype)databasePoolWithPath:(NSString*)aPath;
 
 /** Create pool using path.
 
@@ -66,7 +66,7 @@
  @return The `FMDatabasePool` object. `nil` on error.
  */
 
-- (id)initWithPath:(NSString*)aPath;
+- (instancetype)initWithPath:(NSString*)aPath;
 
 ///------------------------------------------------
 /// @name Keeping track of checked in/out databases

+ 2 - 2
src/FMDatabasePool.m

@@ -23,11 +23,11 @@ @implementation FMDatabasePool
 @synthesize maximumNumberOfDatabasesToCreate=_maximumNumberOfDatabasesToCreate;
 
 
-+ (id)databasePoolWithPath:(NSString*)aPath {
++ (instancetype)databasePoolWithPath:(NSString*)aPath {
     return FMDBReturnAutoreleased([[self alloc] initWithPath:aPath]);
 }
 
-- (id)initWithPath:(NSString*)aPath {
+- (instancetype)initWithPath:(NSString*)aPath {
     
     self = [super init];
     

+ 2 - 2
src/FMDatabaseQueue.h

@@ -80,7 +80,7 @@
  @return The `FMDatabaseQueue` object. `nil` on error.
  */
 
-+ (id)databaseQueueWithPath:(NSString*)aPath;
++ (instancetype)databaseQueueWithPath:(NSString*)aPath;
 
 /** Create queue using path.
 
@@ -89,7 +89,7 @@
  @return The `FMDatabaseQueue` object. `nil` on error.
  */
 
-- (id)initWithPath:(NSString*)aPath;
+- (instancetype)initWithPath:(NSString*)aPath;
 
 /** Close database used by queue. */
 

+ 2 - 2
src/FMDatabaseQueue.m

@@ -21,7 +21,7 @@ @implementation FMDatabaseQueue
 
 @synthesize path = _path;
 
-+ (id)databaseQueueWithPath:(NSString*)aPath {
++ (instancetype)databaseQueueWithPath:(NSString*)aPath {
     
     FMDatabaseQueue *q = [[self alloc] initWithPath:aPath];
     
@@ -30,7 +30,7 @@ + (id)databaseQueueWithPath:(NSString*)aPath {
     return q;
 }
 
-- (id)initWithPath:(NSString*)aPath {
+- (instancetype)initWithPath:(NSString*)aPath {
     
     self = [super init];
     

+ 1 - 1
src/FMResultSet.h

@@ -60,7 +60,7 @@
  @return A `FMResultSet` on success; `nil` on failure
  */
 
-+ (id)resultSetWithStatement:(FMStatement *)statement usingParentDatabase:(FMDatabase*)aDB;
++ (instancetype)resultSetWithStatement:(FMStatement *)statement usingParentDatabase:(FMDatabase*)aDB;
 
 /** Close result set */
 

+ 1 - 1
src/FMResultSet.m

@@ -11,7 +11,7 @@ @implementation FMResultSet
 @synthesize query=_query;
 @synthesize statement=_statement;
 
-+ (id)resultSetWithStatement:(FMStatement *)statement usingParentDatabase:(FMDatabase*)aDB {
++ (instancetype)resultSetWithStatement:(FMStatement *)statement usingParentDatabase:(FMDatabase*)aDB {
     
     FMResultSet *rs = [[FMResultSet alloc] init];