views:

73

answers:

3

Hi

Im using the table view in the view controller,with the simple array was displayed in the list.that array was displays and works fine but im getting this Warning.may i know the reason for this and please some ideas to rectify this issues..

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.

Thanks

A: 

Its just saying that this method is about to disappear in next version, so you should go to documentations look for tableView:accessoryTypeForRowWithIndexPath and surely you will find alternative ways of doing what you want you want to do.

In other words, set the accessory of that cell by calling UITableViewCell accessory-view and accessory-type properties

myCell.accessoryType = ...
myCell.accessoryView = ...
nacho4d
Hi Nacho due to there is no enough space,i have answered in the answer tab pls,chk my code .wher im making the mistakeThanks for your advice!!!
siva
A: 

The method tableView:accessoryTypeForRowWithIndexPath: is deprecated in iPhone OS 3.0. Delete the implementation of this method and add the following code in the method cellForRowAtIndexPath: :

cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;

See UITableViewCellAccessoryType in the documentation for other type.

MathieuF
Hi Mathieuf due to there is no enough space,i have answered in the answer tab pls,chk my code .wher im making the mistakeThanks for your advice!!!
siva
Have you deleted the method tableView:accessoryTypeForRowWithIndexPath: ?
MathieuF
ya i have deleted MathieuF now its not showing that warning,thanks a lot :P
siva
A: 

Hi MathieuF Im using the following code as you mentioned // Customize the appearance of table view cells. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

static NSString *CellIdentifier = @"Cell";

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
    cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
}
// Set up the cell...
cell.text = [arry objectAtIndex:indexPath.row];
cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
return cell;

} But it returns the same

siva