摘要: - (NSString *)title { return [[title retain] autorelease];}- (void)setTitle:(NSString *)newTitle { if (title != newTitle) { [title release]; title = [newTitle retain]; }} 阅读全文
posted @ 2012-06-30 10:43 有容乃大 阅读(232) 评论(0) 推荐(0) 编辑
摘要: 1. 数据类型。int %ofloat %fcouble %char %c2.实例变量作用域的指令:@protected 实例变量可被该类及任何子类中定义的方法直接访问(默认的情况)。@private 实例变量可被定义在该类的方法直接访问,不能被子类定义的方法直接访问。@public 实例变量可被... 阅读全文
posted @ 2012-06-30 10:41 有容乃大 阅读(2068) 评论(0) 推荐(0) 编辑
摘要: // 初始化锁对象ticketCondition = [[NSCondition alloc] init];//开始第一个线程。ticketsThreadone = [[NSThread alloc] initWithTarget:self selector:@selector(run) object:nil];[ticketsThreadone setName:@"Thread-1"];[ticketsThreadone start];//开始第二个线程。ticketsThreadtwo = [[NSThread alloc] initWithTarget:self se 阅读全文
posted @ 2012-06-30 10:38 有容乃大 阅读(9251) 评论(0) 推荐(0) 编辑
摘要: UILabel *label = [[ UILabel alloc] init];label.text = @"xxx";label.frame = CGRectMake(0,0,100,100) ;label.backgroundColor = [UIColor redColor];//添加事件。label.userInteractionEnabled = YES;UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector( 阅读全文
posted @ 2012-06-30 10:36 有容乃大 阅读(11788) 评论(0) 推荐(0) 编辑