TableView没有显示任何数据

时间:2014-08-18 01:44:34

标签: objective-c ios7 tableview tableviewcell

我希望能在这里挑选一位天才的大脑。我想教自己开始创建一些更高级的iOS UI视图。所以这就是我所拥有的:

  • 一个视图控制器,上半部分是UIImageView,下半部分是一个视图区域,它包含一个TableView
  • TableView有一个自定义的TableViewCell。我已经为自定义TableViewCell
  • 创建了属性
  • 我已经为我的TableViewCell提供了重用标识符名称
  • 我已将UITableViewDataSource委托添加到自定义View Controller类

现在,当我运行程序时,没有数据显示。没有错误或任何内容,但没有数据显示。

以下是我在View Controller类中进行测试的代码片段:

- (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 4;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    LVGPersonEventTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"personEventTableCell" forIndexPath:indexPath];

    // Configure the cell...
    cell.eventDayLabel.text = @"Monday";
    cell.eventMonthDateLabel.text = @"June 18";
    cell.eventVenueNameLabel.text = @"Club Rain";
    cell.eventAddressLabel.text = @"Address....";
    cell.eventTimeLabel.text = @"11PM - 3AM";

    return cell;
}

0 个答案:

没有答案
相关问题