Прилагаемый код возвращает ошибку:управления может достигать конец непусто функции
Control may reach end non-void function
Код:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.row == 0) {
FirstCustomCell *fCustomCell = [tableView dequeueReusableCellWithIdentifier:@"firstCustomCell" forIndexPath:indexPath];
if (fCustomCell == nil) {
fCustomCell = [[FirstCustomCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"firstCustomCell"];
}
return fCustomCell;
}
else if (indexPath.row == 1) {
SecondCustomCell *sCustomCell = [tableView dequeueReusableCellWithIdentifier:@"secondCustomCell" forIndexPath:indexPath];
if (sCustomCell == nil) {
sCustomCell = [[SecondCustomCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"SecondCustomCell"];
}
return sCustomCell;
}
} //<-- Control may reach non-void function (I precise that's the end of the cellForRowAtIndexPath method)
Я знаю, что эта проблема особенно на «возвращение», но как Я устраняю ошибку?
Благодарим за ответ! Да для «secondCustomCell», который был из-за опечаток, когда я копирую/вставляю блок кода, я редактировал маленькие вещи перед ^^ – Lkm