UITableViewController

目录

  • 概述
  • UITableView
  • UITableViewCell
  • 与UITableViewController相关的代理

UITableViewDataSource

UITableViewDelegate

  • UITableViewController的常用操作

选中单元格

编辑、移动、添加、删除单元格

索引的创建

根据关键字排序

下拉或上拉刷新表格视图

搜索框和表格视图的交互

概述

对UITableViewController的理解

UITableView

视图控制器

UITableViewController或其子类

非UITableViewController或其子类,需手动设置UITableView的dataSource和delegate这两个代理

UITableViewCell

样式

系统自带UITableViewCell样式

自定义UITableViewCell样式

与UITableViewController相关的代理

UITableViewDataSource

UITableViewDelegate

UITableViewController的常用操作

选中单元格

相关的代理方法(4个):- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath

编辑、移动、添加、删除单元格

编辑

- (void)setEditing:(BOOL)editing animated:(BOOL)animate

删除

- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath

添加

+ (NSIndexPath *)indexPathForRow:(NSInteger)row inSection:(NSInteger)section

- (void)insertRowsAtIndexPaths:(NSArray *)indexPaths withRowAnimation:(UITableViewRowAnimation)animation

移动

- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath

- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath

索引的创建

UITableViewController的更多相关文章

  1. iOS UITableView 与 UITableViewController

    很多应用都会在界面中使用某种列表控件:用户可以选中.删除或重新排列列表中的项目.这些控件其实都是UITableView 对象,可以用来显示一组对象,例如,用户地址薄中的一组人名.项目地址. UITab ...

  2. UITableViewController和XML解析还有地图的简单结合

    然后我的代码就按照上面的这个顺序输出. #import <Foundation/Foundation.h> #import <MapKit/MapKit.h> @interfa ...

  3. UITableViewController和延时执行、自定义控件

    1.在UITableViewController中,self.view就是self.tableView, 两个对象的指针地址是一样的 2.自定义类继承UITableViewCell, 重写父类方法 / ...

  4. iOS--通讯录(UITableViewController)

    本文主要实现通讯录的部分功能(分组名.索引.分组的组名)等等功能: 废话不多说了,先上效果图: 在工程中需要导入一个plist文件,文件图如图: 工程目录文件如图: 工程程序如图所示: RootTab ...

  5. iOS--(UITableViewCell)、(UITableViewController)微信个人主页

    本文主要实现了微信的个人主页的设置: 目录文件如下: 实现代码如下: RootTableViewController.h #import <UIKit/UIKit.h> @interfac ...

  6. iOS UITableView , UITableViewController ,UITableViewCell实现全国各省市遍历,选择相应的地区

    我们先看一下效果                   代码如下 首先是第一个页面 rootTableViewController.h #import <UIKit/UIKit.h> #im ...

  7. iOS7上在xib中使用UITableViewController设置背景色bug

    今天用xcode5.1设置xib中,用静态的方式设置UITableViewController中的tableview,把tableview中的backgroundColor改变后,xib上有效果,但是 ...

  8. UITableView & UITableViewController

    内容概要: 本文先讲解了UITableView概述,然后主要从应用方面讲解了UITableViewController(包括add.delete.move单元cell的操作,以及UITableView ...

  9. iOS - UITableViewController

    前言 NS_CLASS_AVAILABLE_IOS(2_0) @interface UITableView : UIScrollView <NSCoding> @available(iOS ...

  10. UITableViewController 滚动引起的cocos2d动画暂停问题的解决

    UITableViewController 滚动引起的cocos2d动画暂停问题的解决 之前在使用UITableViewController进行滚动时,cocos2d的动画会暂停,直至滚动完毕才会继续 ...

随机推荐

  1. scrollTop

    scrollTop 表示滚动的高度,默认从position:0;开始向下滚,scrollTop(offset)的offset表示相对顶部的偏移,以像素计,<br/> scrollTop() ...

  2. Mysql报错:1172 - Result consisted of more than one row

    执行mysql函数时报错:1172 - Result consisted of more than one row 函数语句中select into语句中WHERE account = userNam ...

  3. Redhat=》中文

    我的redhat安装时没有提示语言选项,由于工程需要,支持汉字是不可避免的,因此就必须安装中文输入法. 安装中文包 将系统光盘镜像文件连接至计算机,我的镜像是RHEL5.1的,先将光盘挂载至/mnt目 ...

  4. android学习笔记---发送状态栏通知

    发送消息的代码如下: //获取通知管理器 NotificationManager mNotificationManager = (NotificationManager) getSystemServi ...

  5. pip install 下载慢的问题

    建个文件 ~/.pip/pip.conf, 内容如下 [global] timeout = 6000 index-url = https://pypi.doubanio.com/simple [ins ...

  6. rhel及相关linux系统版本知识

    Rhel 此处Rhel非等同redhat哦,RedHat是红帽公司在1994年左右开发维护的linux桌面版本,在2004年左右红帽公司放弃redhat开始进军linux服务器版本开发,具体见下截图 ...

  7. QueryInterface

    QueryInterface IUnknown *p2; hr = pInnerUnknown->QueryInterface(vGUID2, (void**)&p2); IUnknow ...

  8. 删除Ngnix 日志

    删除Ngnix日志的脚本 #!/bin/bash #初始化 LOGS_PATH=$(pwd)/logs YESTERDAY=$(date -d "yesterday" +%Y-%m ...

  9. svn如何回滚到之前版本

    第一种情况:改动没有被提交(commit). 这种情况下,使用svn revert就能取消之前的修改. svn revert用法如下: # svn revert [-R] something 其中so ...

  10. does not support ASP.NET compatibility 错误

    The service cannot be activated because it does not support ASP.NET compatibility. ASP.NET compatibi ...