Kiedy dokładnie można uzyskać wywołanie layoutSubviews
na niestandardowej metodzie UITableViewCell
w metodzie cellForRowAtIndexPath
? Poniżej potrzebuję layoutSubviews
nazywać się PO ustawieniu właściwości FiltersTableViewCellItem
. Czy mam poprawnie skonfigurowany ten zestaw? Chciałbym móc używać layoutSubviews
, ponieważ słyszałem, że jest to lepsze z punktu widzenia wydajności.Kiedy dokładnie robi layoutSubviews wywoływane dla niestandardowego UITableViewCell?
- (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *cellIdentifier = @"FiltersTableViewCell";
FiltersTableViewCell *filtersTableViewCell = [[self dequeueReusableCellWithIdentifier:cellIdentifier] retain];
FiltersTableViewCellItem *filtersTableViewCellItem = [[self.filtersTableViewCellItems objectAtIndex:[indexPath row]] retain];
if (!filtersTableViewCell)
{
filtersTableViewCell = [[FiltersTableViewCell alloc] initWithFiltersTableViewCellItem:filtersTableViewCellItem];
filtersTableViewCell.delegate = self;
}
else
{
filtersTableViewCell.filtersTableViewCellItem = filtersTableViewCellItem;
}
return [filtersTableViewCell autorelease];
}
@Danny Lin ARC nie ma nic wspólnego z poprawą wydajności. W rzeczywistości ma ten sam efekt co autoreasada. –