Created
September 5, 2012 19:35
-
-
Save ccarse/3643199 to your computer and use it in GitHub Desktop.
kvcMagic: for more than just strings....
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
- (void)enhancedKvcMagic:(id)object { | |
int columnCount = sqlite3_column_count([_statement statement]); | |
int columnIdx = 0; | |
for (columnIdx = 0; columnIdx < columnCount; columnIdx++) { | |
id c = [self objectForColumnIndex:columnIdx]; | |
// check for a null row | |
if (c) { | |
[object setValue:c forKey:[NSString stringWithUTF8String:sqlite3_column_name([_statement statement], columnIdx)]]; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment