Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

lJoct03

macrumors member
Original poster
Nov 18, 2009
31
0
WARNING: Using legacy cell layout due to delegate implementation of tableView:accessoryTypeForRowWithIndexPath: in <RootViewController: 0x685f100>. 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.

Code:
- (UITableViewCellAccessoryType)tableView:(UITableView *)tv accessoryTypeForRowWithIndexPath:(NSIndexPath *)indexPath
{
    //return UITableViewCellAccessoryDetailDisclosureButton;
    //return UITableViewCellAccessoryDisclosureIndicator;
    return UITableViewCellAccessoryNone;
}

How do i do this?
Any help would be greatly appreciated.
 
Set the property on the cell in your cellForRowAtIndexPath method and remove the old method that it doesn't like.

Code:
cell.accessoryType = UITableViewCellAccessoryNone;
 
Here's my cellForRowAtIndexPath. Where do i remove the old method that it doesn't like? And what is the old method that it doesn't like? Thanks for the help.

Code:
- (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];
    }
    
    // Set up the cell...
    if(searching) 
        cell.textLabel.text = [copyListOfItems objectAtIndex:indexPath.row];
    else {
    //First get the dictionary object
	NSDictionary *dictionary = [listOfItems objectAtIndex:indexPath.section];
    NSArray *array = [dictionary objectForKey:@"News"];
    NSString *cellValue = [array objectAtIndex:indexPath.row];
    cell.textLabel.text = cellValue;
    }
    return cell;
}
 
This is the method that has been deprecated:

tableView:accessoryTypeForRowWithIndexPath: in <RootViewController: 0x685f100>

If you want none of the cells to be selectable then add the code I showed like this:

Code:
- (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.accessoryType = UITableViewCellAccessoryNone;
    }
    
    // Set up the cell...
    if(searching) 
        cell.textLabel.text = [copyListOfItems objectAtIndex:indexPath.row];
    else {
    //First get the dictionary object
	NSDictionary *dictionary =[listOfItems objectAtIndex:indexPath.section];
    NSArray *array = [dictionary objectForKey:@"News"];
    NSString *cellValue = [array objectAtIndex:indexPath.row];
    cell.textLabel.text = cellValue;
    }
    return cell;
}
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.