|
@@ -98,24 +98,36 @@
|
|
|
|
|
|
|
|
cell.detailTextLabel.text=item_arr[0][1];
|
|
cell.detailTextLabel.text=item_arr[0][1];
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ if ([self.checkedData containsObject:[NSNumber numberWithInteger:indexPath.row]]) {
|
|
|
|
|
+ cell.accessoryType = UITableViewCellAccessoryCheckmark;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ cell.accessoryType = UITableViewCellAccessoryNone;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
return cell;
|
|
return cell;
|
|
|
}
|
|
}
|
|
|
-- (UITableViewCellAccessoryType)tableView:(UITableView*)tableView accessoryTypeForRowWithIndexPath:(NSIndexPath*)indexPath
|
|
|
|
|
-{
|
|
|
|
|
- if([self.checkedData containsObject:[NSNumber numberWithLong:indexPath.row]])
|
|
|
|
|
- {
|
|
|
|
|
- return UITableViewCellAccessoryCheckmark;
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- return UITableViewCellAccessoryNone;
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
|
|
+//- (UITableViewCellAccessoryType)tableView:(UITableView*)tableView accessoryTypeForRowWithIndexPath:(NSIndexPath*)indexPath
|
|
|
|
|
+//{
|
|
|
|
|
+// if([self.checkedData containsObject:[NSNumber numberWithLong:indexPath.row]])
|
|
|
|
|
+// {
|
|
|
|
|
+// return UITableViewCellAccessoryCheckmark;
|
|
|
|
|
+// }
|
|
|
|
|
+// else
|
|
|
|
|
+// {
|
|
|
|
|
+// return UITableViewCellAccessoryNone;
|
|
|
|
|
+// }
|
|
|
|
|
+//}
|
|
|
#pragma mark tableview delegate
|
|
#pragma mark tableview delegate
|
|
|
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
|
|
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
|
|
|
{
|
|
{
|
|
|
- UITableViewCell* cell = [tableView cellForRowAtIndexPath:indexPath];
|
|
|
|
|
|
|
+ UITableViewCell* cell = [tableView cellForRowAtIndexPath:indexPath];
|
|
|
|
|
+
|
|
|
|
|
+// if (![tableView.delegate respondsToSelector:@selector(tableView:accessoryTypeForRowWithIndexPath:)]) {
|
|
|
|
|
+// cell.accessoryType = [self tableView:tableView accessoryTypeForRowWithIndexPath:indexPath];
|
|
|
|
|
+// }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
if(self.single_select)
|
|
if(self.single_select)
|
|
|
{
|
|
{
|
|
|
[self.checkedData removeAllObjects];
|
|
[self.checkedData removeAllObjects];
|
|
@@ -137,6 +149,15 @@
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 消除警告:tableView:accessoryTypeForRowWithIndexPath:
|
|
|
|
|
+ if([self.checkedData containsObject:[NSNumber numberWithLong:indexPath.row]])
|
|
|
|
|
+ {
|
|
|
|
|
+ cell.accessoryType = UITableViewCellAccessoryCheckmark;
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ cell.accessoryType = UITableViewCellAccessoryNone;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
// cell.accessoryType=UITableViewCellAccessoryCheckmark;
|
|
// cell.accessoryType=UITableViewCellAccessoryCheckmark;
|
|
|
|
|
|