Suppose I am holding data in an array like this
wordList = [[NSMutableArray alloc] init];
while ([rs next]) //Some database return loop
{
wordDict = [[NSMutableDictionary alloc] init];
[wordDict setObject:[NSNumber numberWithInt:[rs intForColumn:@"id"]] forKey:@"id"];
[wordDict setObject:[rs stringForColumn:@"word"] forKey:@"word"];
[wordList addObject: wordDict];
[wordDict release];
wordDict = nil;
}
But I want to store this result (i.e. wordList) in SQLite for later use - I guess using NSCoding
. How would I do that?
(Feel free to point out any errors in how stuff is being alloc'ed if there are problems there).