This is my code:
- (void) addOrder {
if(addStmt == nil) {
const char *sql = "insert into item(menuid,itemName,price,quantity,spiciness) Values(?, ?, ?, ?, ?)";
if(sqlite3_prepare_v2(database, sql, -1, &addStmt, NULL) != SQLITE_OK)
NSAssert1(0, @"Error while creating add statement. '%s'", sqlite3_errmsg(database));
}
sqlite3_bind_int(addStmt, 1, [menuID integerValue]);
sqlite3_bind_text(addStmt, 2, [itemName UTF8String], -1, SQLITE_TRANSIENT);
sqlite3_bind_double(addStmt, 3, price );
sqlite3_bind_int(addStmt, 4, [quantity integerValue]);
sqlite3_bind_text(addStmt, 5, [spiciness UTF8String],-1,SQLITE_TRANSIENT);
if(SQLITE_DONE != sqlite3_step(addStmt))
NSAssert1(0, @"Error while inserting data. '%s'", sqlite3_errmsg(database));
else
menuID = sqlite3_last_insert_rowid(database);
//Reset the add statement.
sqlite3_reset(addStmt);
}
My menuID is NSdecimalNumber.In the else portion
menuID = sqlite3_last_insert_rowid(database);
I got error as
“Implicit conversion of sqlite3_int64 to NsdecimalNumber is disallowed with ARC.
How could I remove this error?Please help..
As you said that menuID is NSDecimalNumber than It should be like,