tableview可以正常显示查询出来的结果,Embed in Navigation Controller之后不能正常显示。 - OurCoders (我们程序员)

OC

tableview可以正常显示查询出来的结果,Embed in Navigation Controller之后不能正常显示。

汗仑尔 发布于 2014年09月23日 | 更新于 2014年09月23日
无人欣赏。

tableview可以正常显示查询出来的结果,Embed in Navigation Controller之后不能正常显示。 正常的也是实现numberOfRowsInSection 和 cellForRowAtIndexPath 方法。未Embed的时候可以正常显示,但是一旦在storyboard中 Editor> Embed in> Navigation Controller 操作后,列表不显示查询的结果了,结果在viewdidload方法中能打印出来。

代码:

 - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
 return [Men count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
 static NSString *CellIdentifier = @"ManCell";
 ManTableViewCell *cell = (ManTableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
 // Configure the cell...
 if (cell == nil) {
 cell = [[ManTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
 }
 AVObject *man = [Men objectAtIndex:indexPath.row];
 AVFile *thumbnail = [man objectForKey:@"avatar"];
 cell.nameLabel.text = [man objectForKey:@"name"];
 cell.thumbnailImageView.image = [UIImage imageWithData:[thumbnail getData]];
 cell.descriptionLabel.text = [man objectForKey:@"description"];
 return cell;
}
暂无回复
登录 或者 注册
发布新帖
相关帖子
相关新闻
最新帖子

AltStyle によって変換されたページ (->オリジナル) /