嘿,在带有 } 的行上出现此错误“控制到达非 void 函数的末尾”。 我究竟做错了什么? 请帮忙
(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
NSLog(@"Here16");
if (section == 0) {
return @"A";
}
if (section == 1) {
return @"B";
}
if (section == 2) {
return @"C";
}
if (section == 3) {
return @"D";
}
if (section == 4) {
return @"E";
}
if (section == 5) {
return @"F";
}
if (section == 6) {
return @"G";
}
if (section == 7) {
return @"H";
}
if (section == 8) {
return @"I";
}
if (section == 9) {
return @"J";
}
if (section == 10) {
return @"K";
}
if (section == 11) {
return @"L";
}
if (section == 12) {
return @"M";
}
if (section == 13) {
return @"N";
}
if (section == 14) {
return @"O";
}
if (section == 15) {
return @"P";
}
if (section == 16) {
return @"Q";
}
if (section == 17) {
return @"R";
}
if (section == 18) {
return @"S";
}
if (section == 19) {
return @"T";
}
if (section == 20) {
return @"U";
}
if (section == 21) {
return @"V";
}
if (section == 22) {
return @"V";
}
if (section == 23) {
return @"W";
}
//if (section==0) {
//return @"X";
//}
if (section == 24) {
return @"Y";
}
if (section == 25) {
return @"Z";
}
//NSLog(@"%d", [listOfItems count]);
NSLog(@"That whole error thing");
}
最佳答案
如果您收到的信件不在您的选择范围内,则不会有任何退还。 (这可能永远不会发生,但这是一个警告......)
尝试在方法末尾添加return nil;
关于iphone - 出现错误 - 'control reaches end of non-void function',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2018314/