Trying to subclass UIView

Discussion in 'iOS Programming' started by Hans Kamp, Mar 24, 2013.

Thread Status:
Not open for further replies.
  1. Hans Kamp macrumors member

    Joined:
    Mar 24, 2013
    Location:
    Enschede, Netherlands
    #1
    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?
     
  2. Hans Kamp thread starter macrumors member

    Joined:
    Mar 24, 2013
    Location:
    Enschede, Netherlands
    #2
    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.
     
  3. ArtOfWarfare macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #3
    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.
     
  4. Hans Kamp thread starter macrumors member

    Joined:
    Mar 24, 2013
    Location:
    Enschede, Netherlands
    #4
    You are right. I wasn't looking in what forum I started this topic.
     
Thread Status:
Not open for further replies.

Share This Page