в моем UITableView я хочу установить для первой новости rss-канала пользовательский tableViewCell (например, тип A), а для других новостей второй, третий и т.д. другой пользовательский tableViewCell (trype B) проблема в том, что пользовательский tableViewCell (trype A), созданный для первых новостей, повторно используется, но любопытно, что количество строк между первым использованием customViewCell (тип A) и вторым внешним видом того же типа customViewCell не равно.
my cellForRowAtIndexPath выглядит так:
- (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
int feedIndex = [indexPath indexAtPosition:[indexPath length] - 1];
Feed *item = [[[[self selectedButton] category] feedsList] objectAtIndex:feedIndex + 1];
static NSString *CellIdentifier = @"Cell";
if(feedIndex == 0){
MainArticleTableViewCell *cell = (MainArticleTableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
cell = [[[MainArticleTableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
[[[cell subviews] objectAtIndex:0] setTag:111];
}
cell.feed = item;
return cell;
}
else{
NewsTableViewCell *cell = (NewsTableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
cell = [[[NewsTableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier orientation:currentOrientation] autorelease];
[[[cell subviews] objectAtIndex:0] setTag:111];
}
cell.feed = item;
return cell;
}
return nil;
}
два типа ячеек имеют разные высоты, которые установлены правильно. может ли кто-нибудь указать мне в правильном направлении, как сделать пользовательскую ячейку типа A появляться только для первых новостей (не повторяясь)? спасибо