I use 2 sqlite db files.
1) fill items from A sqlite db.
@property (nonatomic, strong) NSMutableArray *items;
…….
FMResultSet *results = [db1 executeQuery:query];
while ([results next]) {
Book *book = [[Book alloc] init];
book.content = [results stringForColumn:@"Zcontent"];
book.title = [results stringForColumn:@"Ztitle"];
book.idx = [results intForColumn:@"Zidx"];
book.highlight_YN = NO;
[items addObject:book];
[book release];
}
2) After then, select items from other -B- sqlite db.
FMDatabase *userDB = [FMDatabase databaseWithPath:userfmdbPath];
NSString *query2 = [NSString stringWithFormat:@"SELECT zidx, highlight_YN FROM zHighlight where zbook = %d and zchapter = %d order by zidx ", pBook,pChapter];
FMResultSet *userresults = [userDB executeQuery:query2];
3) Question : I want to modify property(highlight_YN) of items with results of userresults compared with results – zidx .
How can I modify NSMutableArray property?
You can loop through the
itemsarray and search for the object.