I saved core data in SQLite file but I am wonder what’s the table name in coredata I have three entities one of them is students.
While trying to using SQLite statement to read it it not enter the while
const char *sqlStatement = "SELECT * FROM students";
sqlite3_stmt *compiledStatement;
if(sqlite3_prepare_v2(database, sqlStatement, -1, &compiledStatement, NULL) == SQLITE_OK) {
while(sqlite3_step(compiledStatement) == SQLITE_ROW) {
NSString *aName = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 1)];
NSLog(aName);
}
}
Any suggestion why not enter the if statement?
Well, you shouldn’t be querying your CoreData tables directly, CoreData is there to abstract the storage from the code. You should use NSFetchRequest. But to answer your question, the table will normally be called zstudents.