Iphone 静态单元格不显示

Iphone 静态单元格不显示,iphone,uitableview,ios5,cell,Iphone,Uitableview,Ios5,Cell,我指的是一个教程,我已经做了所有它说的,但仍然我的静态细胞不显示,任何有关这方面的帮助 但它可以在我的tableview中添加与其连接的数据 这是我故事板上的屏幕 这是我的模拟器屏幕 更新1 当我有这样的更改代码时,将显示节,但仍不显示行 - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { // Return the number of sections. return 2; } - (N

我指的是一个教程,我已经做了所有它说的,但仍然我的静态细胞不显示,任何有关这方面的帮助

但它可以在我的tableview中添加与其连接的数据

这是我故事板上的屏幕

这是我的模拟器屏幕

更新1

当我有这样的更改代码时,将显示节,但仍不显示行

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{

    // Return the number of sections.
    return 2;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{

    // Return the number of rows in the section.
    return 0;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

    // Configure the cell...

    return cell;
}

在PlayerDetailVewController.h委托中

    @class Player;
    @class PlayerDetailsViewController;

    @protocol PlayerDetailsViewControllerDelegate <NSObject>
    - (void)playerDetailsViewControllerDidCancel:
    (PlayerDetailsViewController *)controller;
    //- (void)playerDetailsViewControllerDidSave:
    //(PlayerDetailsViewController *)controller;
    - (void)playerDetailsViewController:
    (PlayerDetailsViewController *)controller 
                           didAddPlayer:(Player *)player;
    @end
@interface PlayerDetailsViewController : UITableViewController

@property (nonatomic, weak) id <PlayerDetailsViewControllerDelegate> delegate;
并显示这样的错误

2012-10-04 13:54:46.152 Rating[514:f803] *** Assertion failure in -[UITableView _createPreparedCellForGlobalRow:withIndexPath:], /SourceCache/UIKit_Sim/UIKit-1914.84/UITableView.m:6061
2012-10-04 13:54:46.154 Rating[514:f803] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath:'
*** First throw call stack:
(0x13cf022 0x1560cd6 0x1377a48 0x9b02cb 0xb3d28 0xb43ce 0x9fcbd 0xae6f1 0x57d21 0x13d0e42 0x1d87679 0x1d91579 0x1d164f7 0x1d183f6 0x1d17ad0 0x13a399e 0x133a640 0x13064c6 0x1305d84 0x1305c9b 0x12b87d8 0x12b888a 0x19626 0x29cd 0x2935)
terminate called throwing an exception(lldb) 

您是否在使用
UITableView
及其
UITableViewCell
的类中正确实现了委托和数据源


您还需要检查
UITableView
的数据源方法中的行数和节数是否正确
UITableView
及其
UITableViewCell
是否在类中正确实现了委托和数据源

您还需要检查
UITableView

的数据源方法中的行数和节数是否正确。您的日志显示

'UITableView数据源必须从tableView:cellForRowAtIndexPath:返回单元格'

这意味着cellforrowatindexpath不能返回任何值。 删除此方法

(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
你的日志上说

'UITableView数据源必须从tableView:cellForRowAtIndexPath:返回单元格'

这意味着cellforrowatindexpath不能返回任何值。 删除此方法

(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath

在你给我们看一段代码之前,我无法知道确切的问题。可能是TableView委托和数据源的问题。在您向我们展示一段代码之前,我无法知道确切的问题。可能是用于TableView委托和数据源的。你说的是什么“静态”单元?如果您返回0,它显然不会显示任何单元格。但如果我将其设为1,则它将显示错误。如果您不显示问题,则无法提供帮助。您所说的是什么“静态”单元格?如果您返回0,它显然不会显示任何单元格。但是如果我将其设为1,则它将显示错误。如果您不显示问题,则无法提供帮助。