开发者

Warning in table view

开发者 https://www.devze.com 2023-01-08 00:01 出处:网络
I\'m 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 I\'m gett开发者_开发问答ing this warning. May I know the r

I'm 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 I'm gett开发者_开发问答ing 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


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.


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


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 = ...
0

精彩评论

暂无评论...
验证码 换一张
取 消