我是iPhone应用程序开发新手。我目前正在研究XML解析。我从XML文件中提取记录并将其存储在可变数组中。我有一个表视图,我从该可变数组中加载表视图。我在调试中发现的表格视图中获得了18行。问题是,当我向下滚动到10行,它移动的很好,但第10行出现应用程序崩溃。我得到了EXC_BAD_ACCESS
的错误。这里是我的代码单元格被加载。谢谢。表视图崩溃
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
if(cell == nil)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];
Location *record = [[Location alloc] init];
record = [[parse locationarr] objectAtIndex:indexPath.row];
cell.textLabel.text = record.locationname;
return cell;
}
}
展示一些你的崩溃日志... – BhushanVU 2013-03-25 10:39:30