Skip to content

Instantly share code, notes, and snippets.

@mahmudahsan
Last active February 7, 2020 05:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mahmudahsan/1bf2ce9eeba58ab9943e7d27fa2ac774 to your computer and use it in GitHub Desktop.
Save mahmudahsan/1bf2ce9eeba58ab9943e7d27fa2ac774 to your computer and use it in GitHub Desktop.
Objective-C Code
const char *sqlStatement = [query UTF8String];
sqlite3_stmt *compiledStatement;
if(sqlite3_prepare_v2(database, sqlStatement, -1, &compiledStatement, NULL) == SQLITE_OK) {
// Loop through the results and add them to the feeds array
while(sqlite3_step(compiledStatement) == SQLITE_ROW) {
// Read the data from the result row
NSString *word = [NSString stringWithUTF8String:(char *)sqlite3_column_tcompiledStatement,
[arrayWords addObject:word];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment