SQLite 데이터베이스에서 작업 중입니다. 데이터베이스에 데이터를 삽입하는 중입니다. 하지만 난 내 코드 중 하나가 저를 도와주세요되어 다음과 같은 곳에 내가 잘못 어떤 일을 오전 생각, 그것의 작동하지 않는 데이터베이스에서 데이터를 삭제하려면 :iPhone의 SQLite 데이터베이스에서 테이블 데이터를 삭제하는 방법
-(IBAction)deleteData {
NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDir = [documentPaths objectAtIndex:0];
NSString *databasePath=[documentsDir stringByAppendingPathComponent:@"paddleEight.sqlite"];
NSLog(@"The Database Path is---> %@", databasePath);
sqlite3_stmt *compiledStatement;
sqlite3 *db;
NSString *sqlStatement = @"DELETE from GalleryTabel;";
if (sqlite3_open([databasePath UTF8String], &db) == SQLITE_OK) {
if (sqlite3_prepare(db, [sqlStatement UTF8String], -1, &compiledStatement, NULL) == SQLITE_OK) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"record" message:@"record Deleted" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
[alert release];
alert=nil;
}
sqlite3_finalize(compiledStatement);
}
}
GalleryTable의 철자를 잘못 입력 했습니까? –
@Toby Allen에게 답해 주셔서 감사하지만 같은 이름을 썼습니다. 논리적 오류를 말해줘. – iPhone4s
@ iPhone4s 혹시이 오류를 우리와 공유 할 수 있으십니까? –