sqlite3_step 문이 101을 반환하지만 실행할 수있는 코드 블록이 있지만 블록 내에있는 코드는 건너 뜁니다. 왜 이럴 수 있니?Xcode : sqlite3_step이 101을 반환하지만 블록 내에서 코드를 실행하지 않습니다.
sqlite3_stmt *statement;
if (sqlite3_open([dbPathString UTF8String], &database) == SQLITE_OK) {
NSLog(@"Value: %li",(long)sender.tag);
NSString *delete_feed = [NSString stringWithFormat:@"DELETE FROM user_data WHERE id = %li", (long)sender.tag];
if (sqlite3_prepare_v2(database, [delete_feed UTF8String], -1, &statement, NULL) == SQLITE_OK) {
NSLog(@"%d", sqlite3_step(statement));
if (sqlite3_step(statement) == SQLITE_DONE) { <== MY ISSUE
NSLog(@"Got here"); <== NEVER GETS HERE
for (UIView *subview in [self.view subviews]) {
if (subview.tag == 2) {
[subview removeFromSuperview];
[self createListPage];
}
}
sqlite3_finalize(statement);
sqlite3_close(database);
}
}
}
뭔가를 시도 할 수 있습니까? '101'은'SQLITE_DONE'입니다. – rmaddy
똑같은'_step' 명령에 대한 바로 앞의 NSLog는 무엇을 말합니까? – Nick
rmaddy와 Nick, NSLog에서 출력 할 때 값은 101을 반환합니다. – pingeyeg