表视图中的警告

问题描述:

我在视图控制器中使用了表视图,并且列表中显示了简单的数组。该数组显示和工作正常,但我收到此警告。我想知道这样做的原因,并请一些想法,以纠正这个问题..表视图中的警告

警告:由于使用传统的单元布局委托执行 的tableView的:accessoryTypeForRowWithIndexPath:英寸请删除此方法的实施,并将单元格属性accessoryType和/或editingAccessoryType设置为 以将其移动到新的单元格布局行为。在将来的版本中,此方法将不再称为 。

感谢

+2

直到你已经接受了一些回答您的问题以前我连惯于看你的问题:) – willcodejavaforfood 2010-07-21 08:00:15

+0

嗨willcodejavaforfood 请指导我如何接受答案。我不能让你的意思是... – siva 2010-07-21 08:30:43

它只是说,这种方法是关于在下一版本中消失,所以你应该去单证寻找的tableView:accessoryTypeForRowWithIndexPath,肯定你会发现这样做的替代方式,你想你想要什么去做。

换句话说,通过调用的UITableViewCell附件视图和附件类型属性

myCell.accessoryType = ... 
myCell.accessoryView = ... 
+0

嗨Nacho由于没有足够的空间,我已经在答案选项卡中回答pls,chk我的代码.wher我犯了错误 谢谢为您的建议! – siva 2010-07-21 10:26:42

方法tableView:accessoryTypeForRowWithIndexPath:在iPhone OS 3.0已被弃用设定该单元的附件。删除此方法的实现,并在方法cellForRowAtIndexPath:添加以下代码:

cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton; 

UITableViewCellAccessoryType其它类型的文档。如你所提到的使用下面的代码

+0

您好Mathieuf由于没有足够的空间,我已经在答案选项卡中回答,chk我的代码.wher我犯了错误 感谢您的意见! – siva 2010-07-21 10:26:38

+0

您是否删除了方法tableView:accessoryTypeForRowWithIndexPath:? – MathieuF 2010-07-21 12:24:51

+0

雅我已经删除了MathieuF现在它不显示该警告,非常感谢:P – siva 2010-07-23 05:08:49

林:

// 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; 
} 

但它返回相同的