surnameField.text = "Fal à èà ò l'opo";
// remove space and apostrophe
NSString *surnarmeInput = [[surnameField.text stringByReplacingOccurrencesOfString:@" " withString:@""] stringByReplacingOccurrencesOfString:@"'" withString:@""];
Run Code Online (Sandbox Code Playgroud)
我也会删除重音符号.
结果"Falaeaolopo"
我正在调用一个方法getAllProductsByManufacturedID,它接收NSInteger作为参数,请参阅下面的代码:
// call the method with int value
[dbAccess getAllProductsByManufacturedID:5];
// method for extract all row with manufactured id = ?
- (NSMutableArray*)getAllProductsByManufacturedID:(NSInteger *)manufactID
{
const char *sql = "SELECT * FROM Product WHERE manufacturerid = ?";
sqlite3_stmt *statement;
if (sqlite3_prepare_v2(database, sql, -1, &statement, NULL)== SQLITE_OK)
{
sqlite3_bind_int(statement, 1, manufactID);
}
}
Run Code Online (Sandbox Code Playgroud)
我认为有两个问题:
1)(NSMutableArray*)getAllProductsByManufacturedID:(NSInteger*)manufactID
2)sqlite3_bind_int(statement,1,manufactID);