toggle quoted messageShow quoted text
When you create a new Mac project, be sure to select macOS templates in the tab bar. There are no “Single-View” Mac templates, which indicates you actually created an iOS project.
Create a new one, this time from the macOS selection.
Also, UIKit is the iOS UI APIs. For the Mac, we use AppKit. You will be working with windows and views for the Mac, while iOS uses views.
Ok next question - this should be obvious but has stopped me.
First I am running Objective-C applications (simple ones so far) as command line applications. So I have the syntax figured out, etc. I can also compile my earlier C and C++ code easily with my Objective-C code. So far my applications output to the console and output files.
But I cannot get a simple GUI application to build.
In VeiwController.h, XCode still says that it cannot find UIKit! I have a line: #import <UIKit/UIKit.h>
and I tried replacing the <> with quotes as well. But it says that 'UIKit/IUKit.h' are not found. Does the single quote tell me something?
I started this project by telling XCode that I am doing a single view MacOS application with Objective-C. That gave me UIKIt but there is not a UIKit.h file, but I also import Cocoa and I do not see a Cocoa.h file in the file structure.
I cannot imagine that UIKit is specific to iPhone and that there is some equivalent for MacOS. All of the examples in the book are for iPhones of course.