0
我在UITableViewController場景中創建了5個靜態單元格。一切工作正常,但我無法設置選定的特定單元格!如果它是原型單元,那麼它很簡單,但我怎麼能設置靜態單元格選擇?以下代碼引發了BAD內存訪問異常!我已根據discussion on apple thread完成此操作,但不知道有什麼問題!有人可以幫忙嗎?iOS 6.0 Storyboard:設置靜態單元格
- (void)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
[super tableView:tableView cellForRowAtIndexPath:indexPath];
if(indexPath.section == _rating)
[tableView cellForRowAtIndexPath:indexPath].accessoryType =UITableViewCellAccessoryCheckmark;
}