Как установить разн. изображение в ячейке в таблице - PullRequest
0 голосов
/ 05 декабря 2009

Как установить различное изображение значка для каждой ячейки в представлении UItable.

1 Ответ

0 голосов
/ 05 декабря 2009

В вашей таблице делегата:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    static NSString *CellIdentifier = @"Cell";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
    }
    cell.imageView.image=[someDataClass methodThatReturnsAnImage]; 
    cell.textLabel.text=[someDataClass methodThatReturnsAString]; 
    return cell;
}
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...