UITableView удалить сразу все строки

Как можно удалить все строки из UITableView сразу? Потому что, когда я перезагружаю табличное представление новыми данными, я все еще вставляю новые строки:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";

    CustomTableViewCell *cell = (CustomTableViewCell*)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[CustomTableViewCell alloc] initWithFrame:CGRectZero] autorelease];
    }

    //... setting the new cell here ...

    return cell;
}

Спасибо.

17
задан Leo 27 April 2012 в 22:16
поделиться