Reputation: 674
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
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
Reputation: 2609
Here is a related question that may have the answer that you are looking for:
Upvotes: 1