我需要使用 UITableView 创建一个 list ,并将accessoryView作为自定义复选框并勾选,最好(快速且高效)的方法是什么?
此外,从accessoryButtonTappedForRowWithIndexPath中勾选/取消勾选它并存储/检索行的当前状态(选中/未选中)的最佳方法是什么:
-(void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath {
if (something==isChecked) {
change accessoryView to unchecked
// do stuff
} else {
change accessoryView to unchecked
// do stuff
}
}
谢谢!
最佳答案
我刚刚发现苹果公司已经创建了一个这样的例子!对于任何寻找相同内容的人来说,这是一个链接:
http://developer.apple.com/iphone/library/samplecode/Accessory/Introduction/Intro.html
关于iphone - 实现自定义 UITableViewCellAccessoryType 以用作复选标记(如待办事项列表)的最佳方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3399121/