RD的CODING筆記
顯示具有
Objective-C 語法
標籤的文章。
顯示所有文章
顯示具有
Objective-C 語法
標籤的文章。
顯示所有文章
2013年7月4日 星期四
Objective-C 類別的定義
類別定義的基本語法
@implementation + method定義 + @end
使用Objective-C定義method
- (void)viewDidLoad
{
[super viewDidLoad];
}
Objective-C宣告
在Objective-C中看到 @Interface 就要聯想到類別
類別宣告三要素
@Interface + 類別名稱 + @end
類別的繼承
@Interface + 類別名稱 + : + 父類別名稱 + @end
ex : @Interface Dog : Animal
類別的member
形容此類別的屬性attribute
以Dog為例,和狗相關的
attribute有名字、體重、性別等.
存取xib或StoryBoard理定義的UI元件.
@Interface + 類別名稱 + : + 父類別名稱 +
{
member 1的type + member 1 的大名 + ;
member 2的type + member 2 的大名 + ;
}
@end
較舊的文章
首頁
訂閱:
文章 (Atom)