这是我从github获得的代码,并且在我评论过的行上崩溃了,我知道EXC BAD ACCESS是当你不保留或释放某些东西但我有ARC启用的时候我不知道该怎么办。UITableView在github上滚动(国家列表)时崩溃
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellIdentifier = @"Cell";
CountryCell *cell = (CountryCell *)[tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if(cell == nil) {
cell = [[CountryCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:cellIdentifier];
}
cell.textLabel.text = [[_dataRows objectAtIndex:indexPath.row] valueForKey:kCountryName]; //here crashes
cell.detailTextLabel.text = [[_dataRows objectAtIndex:indexPath.row] valueForKey:kCountryCallingCode]; //here crashes
return cell;
}
是否GitHub的文件您已经下载有没有ARC支持? – GenieWanted
不说什么,这是一个https://github.com/pradyumnad/Country-List/blob/master/README.md – Elgert
你的意思是id?无所谓桌面被加载,但滚动 – Elgert