开发者

UIKit.h and Foundation.h in Objective-C

开发者 https://www.devze.com 2023-01-09 07:53 出处:网络
If you import UIKit.h does that also automatically import开发者_运维百科 Foundation.h?UIKit.h doesn\'t explicitly include it, but I wouldn\'t be surprised if one of the other UIKit headers does.

If you import UIKit.h does that also automatically import开发者_运维百科 Foundation.h?


UIKit.h doesn't explicitly include it, but I wouldn't be surprised if one of the other UIKit headers does.

However, all of your files will have it anyway, because your default pch (precompiled header, or the header that's automatically added to every file in your project) comes with this:

#ifdef __OBJC__
    #import <Foundation/Foundation.h>
    #import <UIKit/UIKit.h>
#endif

This means that every file in your iPhone app will automatically have Foundation and UIKit imported.

0

精彩评论

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