From: Dan W. <dwe...@ri...> - 2003-12-02 05:30:26
|
I did indeed subclass it in interface builder, and I have read up on cocoa. For what its worth, I still have been unable to discover the cause of the errors. I was able to duplicate the error in new projects (with a control or two and an AppController subclass), created from the rubycocoa templates in xcode and again in project builder. At this point I was incredibly frustrated and completely baffled. I went over every single word of code and every aspect of my nib files. They were all solid. As a last resort I finally decided to try something i figured wouldn't work. I went into one of the example NSObject subclass files and copied the "< OSX::NSObject" part (even though it was the exact same in my document). I deleted that part from my file and pasted the section from the other. To my amazement, the error disappeared. In it's place, were several more extremely odd errors. For instance it claimed that my "end" tags were void expressions. I checked and I had the right number of tags. I got so fed up with trying to get rid of the errors, that I decided to start over completely from scratch. This time I used project builder (even though my earlier experiments had yielded the same errors). The first thing I did was to create my interface, and subclass NSObject. I wrote up the class definition with a few outlet initializations and an action that did nothing. I was once again surprised when my application built and ran without error. I broke down my code in to very small chunks, and worked at an extremely slow place, doing one small step, then building and such. Even after copying in my code (the exact same code mind you) it continued to build. The only thing I did different was to use a regular ruby class instead of an NSObject subclass for my support class. I know that factor wasn't the cause of the initial error, though. Because it failed at my controller class too. I am just as amazed, and confounded by these events as I imagine you may be after reading it. I'm not new to programming, I have worked with cocoa before, and I picked up ruby in a day. I'm used to dealing with bugs in my code, sometimes even hard to find ones. However, ruby has such a clean syntax, and rubycocoa is likewise fairly straightforward, and my application was pretty small as programs go, that I was able to analyze every character, every space, everything in my code. The one thing I hate more than most other things, is when a computer/application does something unexpected, defies logic. I still don't know why my code didn't work before, or why it works now. I guess the moral of the story is that when all the solutions that should work don't, the only thing left to do is the stuff that shouldn't work at all. -Dan Weinand btw. I now have a fully operational pre-alpha executable that I'm testing on various other computers. Ruby and RubyCocoa are great...when they work. On Dec 1, 2003, at 7:23 PM, FUJIMOTO Hisakuni wrote: > At Sat, 29 Nov 2003 16:26:26 -0600, > Dan Weinand wrote: >> My rubycocoa application has two classes derived from NSObject. One is >> a standard AppController, and the other is just a simple support >> class. >> >> When I build my application it comes up with "Unknown class >> `AppController' in nib file, using `NSObject' instead." The same error >> occurs with my other class. >> >> I checked and all of the examples build fine. I have gone through >> every >> piece of code in the samples to try and find out what I'm missing, but >> I can't find anything. >> >> My class files are named the exact class name in IB (including case). >> They are in the same folder as the project file. >> I have all my require and includes, and my class definitions are in >> the >> exact same format as in the examples. > > You forgot to do subclassing AppController on "classes" tab of a > nib window of Interface Builder. Didn't you? If this guess is > wrong, I'm sorry. > > Have you learned some simple tutorial of Cocoa like Currency > Converter with Objective-C, Java or others? If you have done, you > can do a same almost with RubyCocoa. > > regards > -- > FUJIMOTO Hisakuni > > > ------------------------------------------------------- > This SF.net email is sponsored by: SF.net Giveback Program. > Does SourceForge.net help you be more productive? Does it > help you create better code? SHARE THE LOVE, and help us help > YOU! Click Here: http://sourceforge.net/donate/ > _______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk |