【发布时间】:2013-12-19 19:16:19
【问题描述】:
我在 tableViewController 类中使用以下代码:
并出现以下错误:
错误:控制到达非空函数的结尾
//customize the appearance of the table view cell
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath: (NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone)
{
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
//configure the cell
cell.textLabel.text = [optionList objectAtIndex:indexPath.row];
}
【问题讨论】:
-
你试过用谷歌搜索错误信息吗?
-
是的,我有很多指向该网站的链接,但每当我尝试使用解决方案时,我发现它永远无法正常工作。
-
@user3120442 在方法主体的末尾添加:
return cell;。 -
天哪,谢谢 Wain!!!!
标签: ios objective-c