IOS 构造和使用TableView(基于storyboard) (二)接收和处理Table View事件
2014-04-02 15:59
489 查看
当某个Cell被按下时触发的事件
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if ([tableView isEqual:self.myTable]) {
NSString *temp = [NSString stringWithFormat:@"Cell %ld in Section %ld is selected",(long)indexPath.section,(long)indexPath.row];
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:temp message:nil delegate:nil cancelButtonTitle:@"OK" otherButtonTitles: nil];
[alert show];
}
}
效果如下
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if ([tableView isEqual:self.myTable]) {
NSString *temp = [NSString stringWithFormat:@"Cell %ld in Section %ld is selected",(long)indexPath.section,(long)indexPath.row];
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:temp message:nil delegate:nil cancelButtonTitle:@"OK" otherButtonTitles: nil];
[alert show];
}
}
效果如下
相关文章推荐
- IOS 构造和使用TableView(基于storyboard) (五)构建页眉和页脚
- IOS 构造和使用TableView(基于storyboard) (六)显示上下文菜单
- IOS 构造和使用TableView(基于storyboard) (三)附件的使用
- IOS 构造和使用TableView(基于storyboard) (四)启用Table Viewcell的滑动删除
- IOS 构造和使用TableView(基于storyboard) (七)移动cell和section
- IOS 构造和使用TableView(基于storyboard) (一)基本的数据显示
- Xcode6 IOS开发UITableView基于Storyboard的使用
- iOS 学习笔记 五 (2015.03.17)使用storyBoard进行tableview的跳转
- iOS界面不能点击(tableView 的cell 不能使用点击事件,tableView也不能上下滚动)
- iOS界面不能点击(tableView 的cell 不能使用点击事件,tableView也不能上下滚动)
- IOS学习——自定义View与使用block实现事件处理入门
- iOS开发storyboard拖拽tableView: Static cells的使用
- iOS storyboard 任意使用static tableView
- 自定义View想使用Scroller实现滑动效果,但是事件接收出现问题,只收到ACTION_DOWN,而无法收到ACTION_MOVE, ACTION_UP等消息的处理
- ios tableView多个cell处理键盘遮挡内容视图的问题
- [ios开发基础之 Core Data[3]]如何使用NSFetchedResultsController 来集成TableView操作
- 【iOS界面处理】使用storyboard实现页面跳转,简单的数据传递
- iOS开发中tableView的分割线的处理问题
- IOS--View的事件响应者处理方式
- iOS开发笔记--TableView的详细使用