-2
-(void)bindStatement:(sqlite3_stmt *)statement withArg:(NSObject *)arg atIndex:(NSUInteger)argIndex
{
if ([arg isEqual:[NSNull null]]) {
sqlite3_bind_null(statement, argIndex);//Implicit conversion loses integer precision: 'NSUInteger' (aka 'unsigned long') to 'int'
} else if ([arg isKindOfClass:[NSNumber class]]) {
NSNumber *numberArg = (NSNumber *)arg;
const char *numberType = [numberArg objCType];
if (strcmp(numberType, @encode(int)) == 0) {
sqlite3_bind_int(statement, argIndex, [numberArg integerValue]);
} else if (strcmp(numberType, @encode(long long int)) == 0) {
sqlite3_bind_int64(statement, argIndex, [numberArg longLongValue]);
} else if (strcmp(numberType, @encode(double)) == 0) {
sqlite3_bind_double(statement, argIndex, [numberArg doubleValue]);
} else {
sqlite3_bind_text(statement, argIndex, [[arg description] UTF8String], -1, SQLITE_TRANSIENT);
}
これはObjective-Cであり、Swiftではありません。 –
[ 'INT' 警告にObjective Cの暗黙的な変換は、整数精度を失う 'NSUInteger'(別名 'unsigned long型')]の可能な重複(http://stackoverflow.com/questions/16918826/objective-c-implicit-conversion-loses -integer-precision-nsuinteger-aka-unsig)を使用します。 –