-(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。
會這麼做... – Anand
但你沒有,是嗎。 –