Professional Web Applications Themes

Ruby & Cocoa Bindings? - Mac Programming

Hi all, Recently I started working with Cocoa Bindings, the Control layer in OSX-Panther, which allows getting rid of most controller-glue-code; a joy indeed! However, it doesn't seem to work with RubyCocoa/Ruby 1.8 ... when I run my dummy-app, I get the following message: /Users/hvs/tmp/bibliotecha/build/bibliotecha.app/Contents/Resources/rb_main.rb:19:in `NSApplicationMain': NSApplicationMain - NSUnknownKeyException - [<Book 0x4f2540> valueForUndefinedKey:]: this class is not key value coding-compliant for the key title. (OSX::OCException) from /Users/hvs/tmp/bibliotecha/build/bibliotecha.app/Contents/Resources/rb_main.rb:19 Am I missing something? thx, Harry...

  1. #1

    Default Ruby & Cocoa Bindings?

    Hi all,
    Recently I started working with Cocoa Bindings, the Control layer in
    OSX-Panther, which allows getting rid of most controller-glue-code; a
    joy indeed!

    However, it doesn't seem to work with RubyCocoa/Ruby 1.8 ... when I
    run my dummy-app, I get the following message:

    /Users/hvs/tmp/bibliotecha/build/bibliotecha.app/Contents/Resources/rb_main.rb:19:in
    `NSApplicationMain': NSApplicationMain - NSUnknownKeyException -
    [<Book 0x4f2540> valueForUndefinedKey:]: this class is not key value
    coding-compliant for the key title. (OSX::OCException)
    from /Users/hvs/tmp/bibliotecha/build/bibliotecha.app/Contents/Resources/rb_main.rb:19


    Am I missing something?

    thx, Harry
    Harry Guest

  2. #2

    Default Re: Ruby & Cocoa Bindings?

    On 22 May 2004 07:14:13 -0700, nl (Harry) wrote: 

    Maybe you are, but we definitely are - like some code!
    Without any context to work from it could be anything from a
    spelling mistake to a Ruby syntax error or a Cocoa
    misapplication. Without code we will be guessing...

    Alan G.
    Author of the Learn to Program website
    http://www.freenetpages.co.uk/hp/alan.gauld
    Alan Guest

  3. #3

    Default Re: Ruby & Cocoa Bindings?

    Alan Gauld <com> wrote in message news:<com>... 
    >
    > Maybe you are, but we definitely are - like some code!
    > Without any context to work from it could be anything from a
    > spelling mistake to a Ruby syntax error or a Cocoa
    > misapplication. Without code we will be guessing...[/ref]

    There is hardly any code, thx to the Cocoa Binding objects, but I see
    what you mean, a little more info may come in handy: my dummy-app was
    in fact the sample-project found at:

    http://www.macdevcenter.com/pub/a/mac/2004/04/06/cocoa.html?page=1

    but instead of an Objective-C Cocoa Doent-Based Application, I
    chose to have a Ruby version of it, and the Book-class goes like this:

    def Book < OSX::NSObject
    attr_accessor :title
    attr_accessor :author
    end

    Everything fine untill running the app from XCode; the error-message
    mentioned before shows up.

    After some more investigation, I think the problem may be the fact
    that RubyCocoa (out-of-the-box) was built under Jaguar, instead of
    Panther; in order to get RubyCocoa working on my Panther system I had
    to adapt it's code a little because the signatures of some classes
    have changed between Jaguar and Panther; I now think we're looking at
    the same problem here. Cocoa Bindings are not supported under Jaguar.

    Harry
    Harry Guest

Similar Threads

  1. Bindings
    By Tobie_Trice in forum Macromedia Dynamic HTML
    Replies: 0
    Last Post: March 31st, 05:35 PM
  2. Bindings - New Recordset
    By Nat5 in forum Dreamweaver AppDev
    Replies: 5
    Last Post: August 2nd, 07:29 PM
  3. Ruby bindings
    By Elias Athanasopoulos in forum Ruby
    Replies: 5
    Last Post: November 4th, 06:54 AM
  4. [ANN] ruby-freedb, ruby-serialport, ruby-mp3info moved to Rubyforge
    By guillaume.pierronnet@ratp.fr in forum Ruby
    Replies: 0
    Last Post: August 31st, 11:57 PM
  5. How to use Bindings?
    By microsoft99 webforumsuser@macromedia.com in forum Macromedia Dreamweaver
    Replies: 0
    Last Post: July 18th, 01:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139