2014-12-04 38 views
0

#import <someclass.h>`#import「someclass.h」有什麼區別?iOS:如何導入一個類,使其成爲父類?

而這裏的是什麼,我認爲,

請糾正我,如果我錯了。

#import "classname.h" // This means importing a class within the same project 

#import <classname.h> // This means importing a class from the local directory 

@interface DerviedClass : ParentClass // This is inheritance 

通過使用所有這些,我們可以使用另一個類的方法和屬性。

我的問題是什麼時候應該使用這些東西,爲什麼?

+4

看來你已經回答了你的問題。 – 2014-12-04 09:19:05

+0

您是否期望發佈有關面向對象編程的課程? – gnasher729 2014-12-04 09:33:48

+1

'「classname.h」'是用戶標題,''是系統標題。 – 2014-12-04 09:37:24

回答

0

#import <>從系統搜索路徑導入文件(開始用的/ usr /通常包括)

#include ""出口從所述用戶的搜索路徑的文件(開始用。通常)

雖然這兩個輸入路徑都在一個Objective-C構建環境非常不同,但基本的區分仍然存在,反映在設置諸如「隨時搜索用戶路徑」

一般來說,你應該使用<>系統和外部包括和項目包括。

相關問題