Explorar o código

The setDateFormat: method explicitly allows a nil parameter to reset to default

Passing in nil resets the DB to use a default unix format. At the moment calling
this method with nil raises a warning in Xcode because it is marked as nonnull
because of the NS_ASSUME_NONNULL_BEGIN marcro.

This commit marks it correctly as _Nullable.
Johannes Fahrenkrug %!s(int64=7) %!d(string=hai) anos
pai
achega
7566f036fa
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      src/fmdb/FMDatabase.h

+ 2 - 2
src/fmdb/FMDatabase.h

@@ -1341,7 +1341,7 @@ typedef NS_ENUM(int, SqliteValueType) {
  @warning Note there is no direct getter for the `NSDateFormatter`, and you should not use the formatter you pass to FMDB for other purposes, as `NSDateFormatter` is not thread-safe.
  */
 
-- (void)setDateFormat:(NSDateFormatter *)format;
+- (void)setDateFormat:(NSDateFormatter * _Nullable)format;
 
 /** Convert the supplied NSString to NSDate, using the current database formatter.
  
@@ -1371,7 +1371,7 @@ typedef NS_ENUM(int, SqliteValueType) {
  @see storeableDateFormat:
  */
 
-- (NSString *)stringFromDate:(NSDate *)date;
+- (NSString * _Nullable)stringFromDate:(NSDate *)date;
 
 @end