objective-c 基础
打鱼的阿猫
这个作者很懒,什么都没留下…
展开
-
self super
在 Objective-C 中的类实现中经常看到这两个关键字 ”self” 和 ”super”,以以前 oop 语言的经验,拿 c++ 为例,self 相当于 this,super 相当于调用父类的方法,这么看起来是很容易理解的。以下面的代码为例:@interface Person:NSObject {NSString* name;}- (void) setName:(NSSt转载 2014-09-20 18:17:20 · 419 阅读 · 0 评论 -
block 循环引用的问题
ARC的本质ARC是编译器(时)特性,而不是运行时特性,更不是垃圾回收器(GC)。不同于XCode4可以在创建工程时选择关闭ARC,XCode5在创建的工程是默认开启ARC,没有可以关闭ARC的选项。如果需要对特定文件开启或关闭ARC,可以在工程选项中选择Targets -> Compile Phases -> Compile Sources,在里面找到对应文件转载 2015-02-09 16:55:10 · 965 阅读 · 0 评论 -
uitoolbar item 自动调整布局
//创建barbuttonitem,样式是flexible,这个种barbuttonitem用于两个barbuttonitem之间 //调整两个item之间的距离.flexible表示距离是动态的,fixed表示是固定的 UIBarButtonItem *flexible = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:原创 2015-07-09 17:29:44 · 1691 阅读 · 0 评论 -
tableview 索引条问题
- (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index// 有问题的写法#pragma mark -- 创建 section-(NSArray *)sectionIndexTitle原创 2015-08-13 17:31:28 · 1212 阅读 · 0 评论