-(NSDictionary*)loadDataRow:(SqlQuery*)q {
return [NSDictionary dictionaryWithObjectsAndKeys: [NSString stringWithFormat:@"%d",[q readIntColumn]],
@"TOCID",[q readTextColumn],@"SubChapter_Name",[q readTextColumn],
@"HtmlFileName",[q readTextColumn],@"ImageName",[q readTextColumn],
@"RefsTitleSection",[NSString stringWithFormat:@"%d",
[q readIntColumn]],@"PageId",
nil];
}
这就是它的名称。readIntColumn 依次调用 readTextColumnWithIndex 和 NSDictionary 返回给调用者方法
chap_Arr = nil;
while([query step]) {
ChapName = [query readTextColumn];
chap_Arr = [mData objectForKey:ChapName];
if (!chap_Arr) {
chap_Arr = [[[NSMutableArray alloc] init] autorelease];
[mData setObject:chap_Arr forKey:ChapName];
}
[chap_Arr addObject:[self loadDataRow:query]];
}
我不确定如何在循环中释放 chap_Arr。我在 dealloc 中有一个 RELEASE_SAFELY。