Posts

Showing posts with the label XCode import

XCode importing a file to whole project

Hi, Sometimes you may encounter situations where you have a file which is used frequently throughout the XCode project. This may be a configurations file which is used in 80% of your code files. Importing this in each file is a certain possibility(and the very normal way with no issues), but if you are lazy and just want to add it in one place, this is the post for you. If you analyze the project, there is a file named <project-name>.pch. There is a block of code which has the following. #ifdef __OBJC__     #import < UIKit/UIKit.h>     #import < Foundation/Foundation.h> #endif NOTE: As you can see, UIKit is already added and so is the Foundation framework. That is why you can use classes such as "UIView" or "NSArray" without any additional imports in your code file. That's just an extra bit of info for the curious !!!. So, likewise, we can add our commonly used file into that block as well in the following manner. #i...