导航

2013年1月6日

摘要: 主要内容点语法@property @synthesize 用法如何使用点语法--------我是分割线--------@peoperty int age; 等价于- (void) setAge:(int)newAge;- (int) age;<newDog.h>#import <Foundation/Foundation.h>@interface newDog : NSObject{ int _age;}@property int age;@end@synthesize age = _age; 等价于- (void) setAge:(int)newAge{ _age = 阅读全文

posted @ 2013-01-06 20:00 ADaii 阅读(188) 评论(0) 推荐(0) 编辑

摘要: 主要内容1.类的声明2.函数/消息的定义的方法3.字段的作用域4.使用Xcode建立项目-----------我是分割线------------1.类的声明<Dog.h>1 #import <Foundation/Foundation.h>2 @interface Dog : NSObject3 {}4 @end2.类的实现<Dog.m>1 #import "Dog.h"2 @implementation Dog3 4 @end3.创建/销毁OC对象创建对象 Dog *dog = [Dog alloc];初始化构造函数 [dog init 阅读全文

posted @ 2013-01-06 00:40 ADaii 阅读(281) 评论(0) 推荐(0) 编辑