Table ViewでStatic Cellsを使うために不要な3つのメソッド。

StoryboardでTable Viewを使ってフォームを作るため、Contentを「Static Cells」にしていたのですが、動かしてみると何も出てくれなくてしばらくハマりました。

ios – UITableView with static cells does not appear – Stack Overflow

Don’t implement any of the methods below when you use the static table view:

対策は、テンプレで吐かれるこの3つを消す。superのメソッドを呼んでみたんですがダメでした。消す。

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView;
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section;
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath;

今年になってiOSアプリを書き始めたんですが、いやぁ知らないことばかりで躓きまくりです。

タイトルとURLをコピーしました