Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
Status
Not open for further replies.

Hans Kamp

macrumors member
Original poster
Mar 24, 2013
38
0
Enschede, Netherlands
I am trying to subclass UIView but I get an error message while trying to compile.

I click on File -> New -> File..., then I click on Objective-C class. I click on Next. After Class I type DrawingView. I click on Next. I click on Create.

The two files are generated.

Then I get the error message that the compiler cannot find <UIKit/UIKit.h>.

Why cannot it find it? Did I forget to install someting?
 
Found out that UIView is for the iPad and iPhone, not for a MacBook.

I am trying to do some simpel drawing but I have no idea to do it. Subclassing NSView will create a second window, but it doesn't react to drawRect.
 
A few things:
If you're programming a Mac app, please go to the Mac programming section of the forums. You're in the iOS programming section right now.

Second, share your code. Simply subclassing a view, whether UIView or NSView, will not instantiate and display that subclass anywhere.
 
Status
Not open for further replies.
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.