为什么仅靠引用UIKit.h就可以调用NSIndexPath?
清醒疯子
由 清醒疯子
发布于 2014年02月24日
无人欣赏。
初步的答案是:
因为UIKit.h里引用了UITableView.h,而UITableView.h里有一个NSIndexPath的Category声明:
@interface NSIndexPath (UITableView)
+ (NSIndexPath *)indexPathForRow:(NSInteger)row inSection:(NSInteger)section;
@property(nonatomic,readonly) NSInteger section;
@property(nonatomic,readonly) NSInteger row;
@end
但为什么要这样搞咧?
共2条回复
楼长
·
yangjie6020
回复于 2014年02月24日
没看明白啊 老兄 写详细点