0
在下面的方法titleForHeaderInSection
,由於某種原因,NSLog打印兩次頭,然後應用程序在objc_msgSend
崩潰。我不明白爲什麼這會導致應用程序崩潰?UITableView titleForHeaderInSection將標題打印到控制檯兩次,然後崩潰
從研究中可以看出,objc_msgSend中的崩潰是通過向已釋放的對象發送消息而引起的,但是這裏是這種情況嗎?
我的sectionNames數組填充在viewDidLoad中。
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
NSString *title = nil;
title=[sectionNames objectAtIndex:section];
NSLog(title);
return title;
}
感謝
'sectionNames = [NSMutableArray arrayWithArray:[aPOI.attributes allKeys]];'其中aPOI是實例變量,屬性是字典 – joec 2010-03-30 20:46:04