fmdb executeUpdate失败

Gan*_*shT 3 objective-c

我究竟做错了什么?这是一个非常简单的陈述,但无法弄清楚是什么导致它失败

    FMDatabase *db = [FMDatabase databaseWithPath:appDelegate.databasePath];
    [db open];
        isSuccess = [db executeUpdate:@"INSERT INTO notes (title, comment, fk) values (?, ?, ?);", title, comment, fkID];
Run Code Online (Sandbox Code Playgroud)

exception.name = NSInvalidArgumentException,exception.reason = - [__ NSCFString comment]:无法识别的选择器发送到实例0x68a93f

Note.h

#import <Foundation/Foundation.h>

@interface Note : NSObject

@property (strong, nonatomic) NSString *title;
@property (strong, nonatomic) NSString *comment;
@property (nonatomic) int fkID;
Run Code Online (Sandbox Code Playgroud)

Par*_*fna 9

看看FMDB的用法.

[db executeUpdate:@"INSERT INTO notes VALUES (?,?,?)", title, comment, [NSNumber numberWithInt:fkID]];  
Run Code Online (Sandbox Code Playgroud)

提供给-executeUpdate:方法的所有参数(或接受va_list作为参数的任何变体)都必须是对象.