Created
November 19, 2013 09:36
-
-
Save hacksoldier/7542755 to your computer and use it in GitHub Desktop.
[DATABASE] Get all information
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (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