私は Objective C と iOS 開発全般にかなり慣れていませんが、まだその感覚をつかもうとしています。しかし、ストーリーボードを使用してメインページとして UITableViewController を使用して (現時点では) シンプルな iOS アプリを作成しようとしています。私はちょうどセルを表示させようとしています。私のコードは次のとおりです。
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
// Return the number of sections.
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
// Return the number of rows in the section.
return 1;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *cervical_patterns = @"cervical_patterns";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cervical_patterns"];
return cell;
}
私は 2 番目の iOS バードウォッチング チュートリアル アプリ(リンク)に厳密に従っており、以前にシミュレーターで表示できるように UITableViewController を取得しました。しかし、これが野鳥観察アプリのように機能しない理由がわかりません。
私が得ているエラーは次のとおりです。
'NSInternalInconsistencyException', reason: 'UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath:
私は何を間違っていますか?