Skip to content

Instantly share code, notes, and snippets.

@hacksoldier
Created November 19, 2013 09:36
Show Gist options
  • Save hacksoldier/7542755 to your computer and use it in GitHub Desktop.
Save hacksoldier/7542755 to your computer and use it in GitHub Desktop.
[DATABASE] Get all information
- (NSArray *)getAll{
NSString * qsql = [NSString stringWithFormat:@"SELECT * FROM '%@'", TABLE_NAME];
sqlite3_stmt *statment;
NSMutableArray *tempArray = [[NSMutableArray alloc] init];
if (sqlite3_prepare_v2(db, [qsql UTF8String], -1, &statment, nil) == SQLITE_OK) {
while (sqlite3_step(statment) == SQLITE_ROW) {
WeightEntry * entry = [WeightEntry alloc];
//char *field1 = (char *) sqlite3_column_text(statment, 0);
//NSString *field1Str = [[NSString alloc] initWithUTF8String:field1];
}//end if
else
NSLog(@"***** Error do not possible get all pesi");
return tempArray;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment