ios海哥开发笔记 (海哥原创,iOS 之iOS 之NSIndexPath )
2016-02-23 12:36
483 查看
是Foundation框架中的一个普通的类,它提供了到嵌套数列的树中特定节点的路径,事实上,它是一个整数阵列,表格视图使用这个去表现在特定章节中的特定行,UITableView用的所有索引路径正好有两个元素,第一个是章节,第二个是行。NSIndexPath和TableViews@interfaceNSIndexPath
(UITableView) {}+(NSIndexPath*)indexPathForRow:(NSUInteger)row
inSection:(NSUInteger)section;@property(nonatomic,readonly)NSUIntegerrow;@property(nonatomic,readonly)NSUIntegersection;@end
NSIndexPath是一種特別的資料類別,這是用來表示一個路徑,這個路徑是指到一個從0開始的巢狀集合陣列樹狀結構的某個節點。iPhone OS為UITableView擴充了這個類別(見NSIndexPath
UIKit Additions這是用分類擴充),加入了一個用來建立新的NSIndexPath實體的「(NSIndexPath *)indexPathForRow:(NSUInteger)row inSection:(NSUInteger)section」方法和row和section兩個屬性。原帖:http://blog.163.com/hw707@126/blog/static/68486388201011255624582/原博文:/article/10909398.htmlnsindexpath的compare方法:compare:Indicates the depth-first
traversal order of the receiving index path and another index path.- (NSComparisonResult)compare:(NSIndexPath
*)indexPath
ParametersindexPathIndex path to compare.This value must not be
the behavior is undefined.
Return ValueThe depth-first traversal ordering of the receiving index path and indexPath.
The receiving index path comes before indexPath.
The receiving index path comes after indexPath.
The receiving index path and indexPath are the same index path.
AvailabilityAvailable in Mac OS X v10.4 and later.
Declared In
(UITableView) {}+(NSIndexPath*)indexPathForRow:(NSUInteger)row
inSection:(NSUInteger)section;@property(nonatomic,readonly)NSUIntegerrow;@property(nonatomic,readonly)NSUIntegersection;@end
NSIndexPath是一種特別的資料類別,這是用來表示一個路徑,這個路徑是指到一個從0開始的巢狀集合陣列樹狀結構的某個節點。iPhone OS為UITableView擴充了這個類別(見NSIndexPath
UIKit Additions這是用分類擴充),加入了一個用來建立新的NSIndexPath實體的「(NSIndexPath *)indexPathForRow:(NSUInteger)row inSection:(NSUInteger)section」方法和row和section兩個屬性。原帖:http://blog.163.com/hw707@126/blog/static/68486388201011255624582/原博文:/article/10909398.htmlnsindexpath的compare方法:compare:Indicates the depth-first
traversal order of the receiving index path and another index path.- (NSComparisonResult)compare:(NSIndexPath
*)indexPath
ParametersindexPathIndex path to compare.This value must not be
nil. If the value is
nil,
the behavior is undefined.
Return ValueThe depth-first traversal ordering of the receiving index path and indexPath.
NSOrderedAscending:
The receiving index path comes before indexPath.
NSOrderedDescending:
The receiving index path comes after indexPath.
NSOrderedSame:
The receiving index path and indexPath are the same index path.
AvailabilityAvailable in Mac OS X v10.4 and later.
Declared In
NSIndexPath.h
相关文章推荐
- ios海哥开发笔记 (海哥原创,iOS 之NSCoding )
- iOS软件安装图文教程(免证书)
- IOS系列——NStimer
- IOS比较常用的第三方组件及应用源代码(持续更新中)
- iOS海哥开发笔记 (海哥原创,NSCharacterSet 简单用法)
- ios海哥开发笔记 (海哥原创,iOS缓存机制NSUserDefaults)
- iOS开发——判断手机格式
- iOS海哥开发笔记 (海哥原创,iOS 通知NSNotificationCenter)
- iOS海哥开发笔记 (海哥原创,retain、strong、weak、assign区别)
- iOS小明开发笔记(八) (容易造成循环引用的三种场景)
- iOS开发之指纹识别
- iOS开发——判断邮箱格式
- iOS开发——MD5加密
- iOS小明开发笔记(七) (iOS设计模式—单例模式)
- iOS学习累积
- 请求数据返回值不能解析
- ios修改textField的placeholder的字体颜色和大小
- textfield监听删除按键 包括没有输入文字时(ios8 也可以使用)
- iOS开发启动页引导图
- ios开发之你真的了解了KVC吗?