interface builder "read class files"

  • i'm new to cocoa programming. some time ago i tried to write simple
    application in tiger and it worked.
    now i'm trying to write the same application under leopard + xcode 3 +
    interface builder 3.0 (629).
    i have a problem adding the class to the interface builder.
    when i do "read class files..." from the file menu and then point
    header file (my_interface_class_with_iboutlets_and_things_like_that.h)
    to add it, ib doesn't say anything. no error, no "ding" etc. the same
    is when i drag myheaderfile.h from xcode browser. it doesn't appear in
    interface builder at all.

    i found some question like this by googling but there was no answer,
    tho.
    may be i do something wrong way but it happens when i do step by step
    tutorial from apple too (the currency converter one). even in the
    final project file downloaded from apple dev site, if i remove
    controllerclass.h from ib i can't reimport it again.

    thanks,
    mikie
  • On Dec 24, 2007, at 1:05 PM, mikie wrote:

    > i have a problem adding the class to the interface builder.
    > when i do "read class files..." from the file menu and then point
    > header file
    > (my_interface_class_with_iboutlets_and_things_like_that.h) to add
    > it, ib doesn't say anything. no error, no "ding" etc. the same is
    > when i drag myheaderfile.h from xcode browser. it doesn't appear in
    > interface builder at all.

    Where are you expecting it to appear?  I suspect what you expect is
    that you will get a new instance in your Interface Builder document --
    however, what you read in was a *class*, not an *instance*.  The
    distinction is critical in Cocoa development.

    To get a new instance in Interface Builder, you drag from the
    Library.  For an instance of a custom class, just drag an NSObject
    over to your document, and then change its class in the Identity pane
    of the Inspector.

      -- Chris
  • After you delete the instantiated object Converter Controller from the
    icon view in the IB window, you have to drag a Object of NSObject type
    into the window again to re-instantiate the object, then change it's
    class to ConverterController.  Unfortunately, there is no feedback
    that IB actually reads the header file.

    This as per the instructions on the tutorial page.  http://developer.apple.com/documentation/Cocoa/Conceptual/ObjCTutorial/06Co
    ntroller/chapter_6_section_6.html#/

    /apple_ref/doc/uid/TP40000863-CH8-SW16

    HTH.

    --
    Jericho

    On Dec 24, 2007, at 1:05 PM, mikie wrote:

    >
    > i'm new to cocoa programming. some time ago i tried to write simple
    > application in tiger and it worked.
    > now i'm trying to write the same application under leopard + xcode 3
    > + interface builder 3.0 (629).
    > i have a problem adding the class to the interface builder.
    > when i do "read class files..." from the file menu and then point
    > header file
    > (my_interface_class_with_iboutlets_and_things_like_that.h) to add
    > it, ib doesn't say anything. no error, no "ding" etc. the same is
    > when i drag myheaderfile.h from xcode browser. it doesn't appear in
    > interface builder at all.
    >
    > i found some question like this by googling but there was no answer,
    > tho.
    > may be i do something wrong way but it happens when i do step by
    > step tutorial from apple too (the currency converter one). even in
    > the final project file downloaded from apple dev site, if i remove
    > controllerclass.h from ib i can't reimport it again.
    >
    > thanks,
    > mikie
    >
  • On 2007/12/25, at 0:10, Chris Hanson wrote:

    >> i have a problem adding the class to the interface builder.
    >> when i do "read class files..." from the file menu and then point
    >> header file
    >> (my_interface_class_with_iboutlets_and_things_like_that.h) to add
    >> it, ib doesn't say anything. no error, no "ding" etc. the same is
    >> when i drag myheaderfile.h from xcode browser. it doesn't appear in
    >> interface builder at all.
    > Where are you expecting it to appear?  I suspect what you expect is
    > that you will get a new instance in your Interface Builder document
    > -- however, what you read in was a *class*, not an *instance*.

    yes... for some reason i expected to have an instance right away. :)

    > The distinction is critical in Cocoa development.

    ... like in every other oo environment i would say :)

    > To get a new instance in Interface Builder, you drag from the
    > Library.  For an instance of a custom class, just drag an NSObject
    > over to your document, and then change its class in the Identity
    > pane of the Inspector.

    ok. now i got it.
    but i'm still confused... why is it that tricky? why doesn't the
    object appear in "custom objects" or so, so i could just drag it as
    is, instead of dragging NSObject and changing the type afterwards?

    thanks a lot guys,
    mikie
previous month december 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
31            
Go to today