?" />
开发者

#import "test.h" Vs #import <test.h>

开发者 https://www.devze.com 2023-02-20 15:28 出处:网络
What is the difference between importing a header file within \"\" and within <开发者_JAVA技巧>?

What is the difference between importing a header file within "" and within <开发者_JAVA技巧>?

Like #import "test.h" Vs #import <test.h>


It will change the search path for the file. Using <> tells the compiler to look through the system path for the proper file/framework, while using "" tells the compiler that the path is relative to the current file.

For example, #import <path/to/file.h> will look through the system paths for the file test.h. The paths include /usr/include and /System/Library/Frameworks, where the first component of the path is treated as the framework to start at. Example paths searched are /usr/include/path/to/file.h and /System/Library/Frameworks/path.framework/Headers/to/file.h. #import "path/to/file.h" will only search the current folder, following the path to find the file, meaning only ./path/to/file.h is searched.


" is for a local include, the .h is part of your application. < is for a system include, the .h is part of a installed library.


"" is for local include while the <> for global include

for more info visit this page

http://msdn.microsoft.com/en-us/library/36k2cdd4%28VS.80%29.aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消