registerNib forCellReuseIdentifier不重用单元格

时间:2012-07-02 08:32:19

标签: iphone objective-c ios

分析我的应用程序,我在“生活”中看到我的单元格(PZCell)的25个实例,如果tableview正确出列,那么应该大约为7。我的代码如下。

- (void)viewDidLoad 
{
    [super viewDidLoad];

    [self.tableView registerNib:[UINib nibWithNibName:@"PZCell" bundle:[NSBundle mainBundle]] 
         forCellReuseIdentifier:@"PZCell"];

    self.tableView.delegate = self;
    self.tableView.dataSource = self;
    self.view.backgroundColor = [UIColor clearColor];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    PZCell *aCell = (PZCell *) [tableView dequeueReusableCellWithIdentifier:@"PZCell"];
    [aCell setResult:[self.result.results objectAtIndex:[indexPath row]]];
    return aCell;
}

在笔尖中设置重用标识符没有区别。任何帮助赞赏。干杯

0 个答案:

没有答案