Tirupati Balan
Tirupati Balan

Reputation: 674

UiTable view warning delegate implementation of tableView:accessoryTypeForRowWithIndexPath:

When i runing my iphone UITableView based application its showing me warning

WARNING: Using legacy cell layout due to delegate implementation of tableView:accessoryTypeForRowWithIndexPath: in . Please remove your implementation of this method and set the cell properties accessoryType and/or editingAccessoryType to move to the new cell layout behavior. This method will no longer be called in a future release.

i also follow "set the cell properties accessoryType and/or editingAccessoryType" but its again showing me same warning.
Please help me to remove this warning..thanks

Upvotes: 1

Views: 1908

Answers (2)

Gaurang Jadia
Gaurang Jadia

Reputation: 1516

Correct, accessoryTypeForRowWithIndexPath delegate method is deprecated. We should use UITableViewCell's accessoryType and accessoryView properties to put control on right side of Cell.

    -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
            UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
            if (cell == nil) {
                    cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];
                    cell.textLabel.text = @"Cell";
                    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
            }
            return cell;
    }

Upvotes: 1

Flipper
Flipper

Reputation: 2609

Here is a related question that may have the answer that you are looking for:

table view Warning

Upvotes: 1

Related Questions