Unable to add classes to IB 3.0

  • I am fairly new to Cocoa and IB but I have background in other
      programming languages. I undertand the MVC Concept and I have a hard
      time adding my classes created in XCode in Interface Builder 3.0
    under
      Leopard.
      I have read the Apple "Cocoa Application Guide" and the "Interface
      builder user guide". Every one of them tells me that IB3 should be
      smart enough to monitor the changes in XCOde and add the appropriate
      classes in IB, but it just doesn't, even with a newly created
    project.
      It does not work either if I use the File->Read Class file menu, IB
      does nothing, no errors, no console logs, nothing happens.
      Same thing happens if I try to drag the .h file from the Xcode
    project
      to IB.
      I have lost a lot of time on this simple task, can anybody help me on
      this ?
      Here is what I am trying to do:
      -Create an empty "Cocoa Application" Project in Xcode 3
      -Add a file named "AppController.h" which is a sub-class of NSObject

    - Ignored:
      -Add 2-3 outlets to AppController
      -Define an action
      -Add the class definition to IB 3.0

      Here is the AppController.h content:
      #import <Cocoa/Cocoa.h>

      @interface AppController : NSObject {
          IBOutlet id imageView;
      IBOutlet id getImageButton;
      }
      - (IBAction) getImage:(id)sender;
      @end
  • > I have lost a lot of time on this simple task, can anybody help me on
    > this ?

      I ran into something similar over the weekend. It "lost its
    connection" it seemed. I quit both XCode and IB3 and re-opened the
    project then the nib. Everything worked fine again after that. Maybe a
    quick relaunch (or even computer restart) will fix it?

    --
    I.S.
  • Den 05/11/2007 kl. 18.01 skrev Charles Hamel:

    > I am fairly new to Cocoa and IB but I have background in other
    > programming languages. I undertand the MVC Concept and I have a hard
    > time adding my classes created in XCode in Interface Builder 3.0
    > under
    > Leopard.
    > I have read the Apple "Cocoa Application Guide" and the "Interface
    > builder user guide". Every one of them tells me that IB3 should be
    > smart enough to monitor the changes in XCOde and add the appropriate
    > classes in IB, but it just doesn't, even with a newly created
    > project.
    > It does not work either if I use the File->Read Class file menu, IB
    > does nothing, no errors, no console logs, nothing happens.
    > Same thing happens if I try to drag the .h file from the Xcode
    > project
    > to IB.
    > I have lost a lot of time on this simple task, can anybody help me on
    > this ?
    > Here is what I am trying to do:
    > -Create an empty "Cocoa Application" Project in Xcode 3
    > -Add a file named "AppController.h" which is a sub-class of NSObject
    >
    > - Ignored:
    > -Add 2-3 outlets to AppController
    > -Define an action
    > -Add the class definition to IB 3.0
    >
    > Here is the AppController.h content:
    > #import <Cocoa/Cocoa.h>
    >
    >
    > @interface AppController : NSObject {
    > IBOutlet id imageView;
    > IBOutlet id getImageButton;
    > }
    > - (IBAction) getImage:(id)sender;
    > @end

    After you have introduced the new interface to IB3 from "Read Class"
    or dragged the interface header to IB3, then go an drag a new Object
    from the Library to the MainMenu.nib window. Open identity inspector
    on that Object, there you can select your Class.

    You can read more about this new way in the "Connections and Bindings"
    section from the "Interface Builder User Guide".

    - Dennis Nilsson
  • My class simply does not appear in the MainMenu.nib file, it's like IB
    doesn't detect anything from the .h file after the parsing.

    Any other clues ?

    Thank you

    Charles
    On 5-Nov-07, at 7:32 PM, Dennis Nilsson wrote:

    >
    > Den 05/11/2007 kl. 18.01 skrev Charles Hamel:
    >
    >> I am fairly new to Cocoa and IB but I have background in other
    >> programming languages. I undertand the MVC Concept and I have a hard
    >> time adding my classes created in XCode in Interface Builder 3.0
    >> under
    >> Leopard.
    >> I have read the Apple "Cocoa Application Guide" and the "Interface
    >> builder user guide". Every one of them tells me that IB3 should be
    >> smart enough to monitor the changes in XCOde and add the appropriate
    >> classes in IB, but it just doesn't, even with a newly created
    >> project.
    >> It does not work either if I use the File->Read Class file menu, IB
    >> does nothing, no errors, no console logs, nothing happens.
    >> Same thing happens if I try to drag the .h file from the Xcode
    >> project
    >> to IB.
    >> I have lost a lot of time on this simple task, can anybody help me on
    >> this ?
    >> Here is what I am trying to do:
    >> -Create an empty "Cocoa Application" Project in Xcode 3
    >> -Add a file named "AppController.h" which is a sub-class of NSObject
    >>
    >> - Ignored:
    >> -Add 2-3 outlets to AppController
    >> -Define an action
    >> -Add the class definition to IB 3.0
    >>
    >> Here is the AppController.h content:
    >> #import <Cocoa/Cocoa.h>
    >>
    >>
    >> @interface AppController : NSObject {
    >> IBOutlet id imageView;
    >> IBOutlet id getImageButton;
    >> }
    >> - (IBAction) getImage:(id)sender;
    >> @end
    >
    > After you have introduced the new interface to IB3 from "Read Class"
    > or dragged the interface header to IB3, then go an drag a new Object
    > from the Library to the MainMenu.nib window. Open identity inspector
    > on that Object, there you can select your Class.
    >
    > You can read more about this new way in the "Connections and
    > Bindings" section from the "Interface Builder User Guide".
    >
    > - Dennis Nilsson
  • Hey Charles -

    I would bet that IB is actually reading your header file just fine,
    but that you're expecting to see a class list somewhere in IB 3.0 like
    you did in IB 2.0. Interface Builder 3.0 doesn't have a class list. If
    you select an object in your document and then use the custom class
    slice of the identify inspector (command+6), you will see that you set
    the custom class with a combo box. You can drop down the combo box to
    see a list of all class names that IB knows about that are valid
    subclass choices for the object you selected. If you had selected an
    instance of NSObject, this list would show you all of the classes that
    IB knows about.

    Another clue that IB is finding your class files correctly is the
    little green/yellow/red dot in the bottom left corner of the main nib
    window. That icon has a tool tip and should display the name of your
    project. If the light is green, and the name of your project is
    showing up next to the light, then IB is automatically reading all of
    your class files from your Xcode Project.

    Good Luck -
    Jon Hess

    On Nov 5, 2007, at 11:20 AM, Charles Hamel wrote:

    > My class simply does not appear in the MainMenu.nib file, it's like
    > IB doesn't detect anything from the .h file after the parsing.
    >
    > Any other clues ?
    >
    > Thank you
    >
    > Charles
    > On 5-Nov-07, at 7:32 PM, Dennis Nilsson wrote:
    >
    >>
    >> Den 05/11/2007 kl. 18.01 skrev Charles Hamel:
    >>
    >>> I am fairly new to Cocoa and IB but I have background in other
    >>> programming languages. I undertand the MVC Concept and I have a hard
    >>> time adding my classes created in XCode in Interface Builder 3.0
    >>> under
    >>> Leopard.
    >>> I have read the Apple "Cocoa Application Guide" and the "Interface
    >>> builder user guide". Every one of them tells me that IB3 should be
    >>> smart enough to monitor the changes in XCOde and add the appropriate
    >>> classes in IB, but it just doesn't, even with a newly created
    >>> project.
    >>> It does not work either if I use the File->Read Class file menu, IB
    >>> does nothing, no errors, no console logs, nothing happens.
    >>> Same thing happens if I try to drag the .h file from the Xcode
    >>> project
    >>> to IB.
    >>> I have lost a lot of time on this simple task, can anybody help me
    >>> on
    >>> this ?
    >>> Here is what I am trying to do:
    >>> -Create an empty "Cocoa Application" Project in Xcode 3
    >>> -Add a file named "AppController.h" which is a sub-class of NSObject
    >>>
    >>> - Ignored:
    >>> -Add 2-3 outlets to AppController
    >>> -Define an action
    >>> -Add the class definition to IB 3.0
    >>>
    >>> Here is the AppController.h content:
    >>> #import <Cocoa/Cocoa.h>
    >>>
    >>>
    >>> @interface AppController : NSObject {
    >>> IBOutlet id imageView;
    >>> IBOutlet id getImageButton;
    >>> }
    >>> - (IBAction) getImage:(id)sender;
    >>> @end
    >>
    >> After you have introduced the new interface to IB3 from "Read
    >> Class" or dragged the interface header to IB3, then go an drag a
    >> new Object from the Library to the MainMenu.nib window. Open
    >> identity inspector on that Object, there you can select your Class.
    >>
    >> You can read more about this new way in the "Connections and
    >> Bindings" section from the "Interface Builder User Guide".
    >>
    >> - Dennis Nilsson

  • Den 05/11/2007 kl. 20.20 skrev Charles Hamel:

    > My class simply does not appear in the MainMenu.nib file, it's like
    > IB doesn't detect anything from the .h file after the parsing.
    >
    > Any other clues ?

    The object will not appear automatically as it did in IB2, you need to
    add a new "Object" from the Library and initialize that with the
    information that IB3 now knows about.

    This might not be the right place to ask this question, go to the
    xcode-users list.

    - Dennis Nilsson
previous month november 2007 next month
MTWTFSS
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30    
Go to today