if (sqlite3_prepare_v2(dbHandlerPointerNote ,selectQuery , -1, &prepareStmtNote, NULL) == SQLITE_OK) {
while (sqlite3_step(prepareStmtNote) == SQLITE_ROW)
{
NSString *noteName = [[NSString alloc]initWithUTF8String:(const char *) sqlite3_column_text(prepareStmtNote, 0)];
[_notesArray addObject:noteName];
int noteid =sqlite3_column_int(prepareStmtNote, 1);
[_noteidArray addObject:[NSString stringWithFormat:@"%d",noteid]];
NSString *noteDate = [[NSString alloc]initWithUTF8String:(const char *) sqlite3_column_text(prepareStmtNote,2)];
[_notesDate addObject:noteDate];
// arrObj is a mutable arr
}
}
note_id
上記は、オブジェクトを配列に追加する方法です。
最後のオブジェクトを取得しようとしている方法は次のとおりです。
_savedNoteid1=[[_modleClass.noteidArray lastObject]intValue];
しかし、正しく動作していません。配列の最後のオブジェクトを取得するにはどうすればよいですか?