我在tableview中有三个部分。三节单元包含3个不同的视图控制器。当用户有机会在桌面视图中点击2个不同部分时,由于后退导航崩溃,我们会崩溃。 UINavigationController异常。我们如何禁用该部分以避免多次分离。iOS - Objective C - UITablview部分禁用
0
A
回答
0
你应该忽略电池部分,你不想来处理:
0
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
//once you get control in this section disable the table for 1 second than in this duration your navigation controller will pop and user will not able to tap second time
[self performSelector:@selector(enableTable) withObject:nil afterDelay:1.0];
tbl.userInteractionEnabled=NO;
}
-(void)enableTable
{
tbl.userInteractionEnabled=YES;
}
0
有一个表视图委托方法的tableView:willSelectRowAtIndexPath:
OS将调用之前的方法选择一个单元格。
实现该方法,并且如果索引路径中的部分是不想选择的部分,则返回nil。
如果你的节数定义为K_SECTION_TO_IGNORE,你的代码可能是这样的:
#define K_SECTION_TO_IGNORE 1
- (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.section == K_SECTION_TO_IGNORE)
return nil;
else
return indexPath;
}
相关问题
- 1. IOS,Tableview Objective C,
- 2. 多部分POST和objective-c
- 3. iOS arc禁用部分代码
- 4. Objective-C&iOS Dev
- 5. Objective-C IOS callscreen
- 6. NSUnknownKeyException ios Objective C
- 7. 检测图像上的大部分黑色像素 - objective-c iOS
- 8. iOS Objective C Webservice调用
- 9. ios - 禁用Objective-C中的按键或隐藏键盘
- 10. Objective-C已禁用iOS BLE配对消息
- 11. iOS Objective-C必读
- 12. ios/objective-c:方法
- 13. 动画ios objective-c
- 14. 中的Objective-C(IOS)
- 15. 上UITablView细胞
- 16. 如何使用NSAttributedString强调字符串的一部分objective-c
- 17. 绘图在Objective-C(IOS)
- 18. Objective-C选择数组的一部分
- 19. Objective-C桥接头部分找不到
- 20. 使用XCodeConfig设置禁用Objective C ARC
- 21. 术语问题Objective-C/iOS
- 22. 部分禁用annotatorjs
- 23. C#部分类与Objective C类别之间的区别?
- 24. Objective C(iOS)设计问题
- 25. 使用Objective-C POST多部分/表单数据
- 26. iOS版 - UIPickerView禁用成分
- 27. Objective-C是否禁止使用结构?
- 28. objective-c在UIButton中禁用拖拽
- 29. 排序UITablview与NSDictonary
- 30. 在Objective-C中分组对象Objective-C