rubycocoa, and 1. hello world 2. nibs

A

anne001

I am starting with ruby, but I would like to use rubycocoa and xcode.

question 1:
-----------------

at the terminal I write
ruby
puts "hello world"
^D

In rubycocoa, what do I need to do to run that code? create a new file?
create a ruby class?

question 2:
----------------

I am running a rubycocoa tutorial, and my version gives me an error,
and the tutorial does not. I copied there controller.rb file and I
still get the error, so I know I messed up something in the nib. How
do I find what is the different in the two nibs? Is there a way of
getting cocoa to show the various links which were established? I can't
use debug to see what is different.

thanks
anne
 
J

Jaypee

anne001 said:
Can you help me with how to debug my nib?

I found the answer to my first question here
http://rubycocoa.sourceforge.net/w.en/ExecutionOrder.html

Apparently, simple ruby code is called in line code. I created a new rb
file in the same directory as main.m and rb_main.rb
and puts "hello world" ran!
nib files are plain text files, so with such simple text tools as an
editor with a "compare files" built-in command, or a "diff" you can get
an idea of where the difference is.
J-P
 
K

Kashia Buch

Hi

nib files are plain text files, so with such simple text tools as an
editor with a "compare files" built-in command, or a "diff" you can get
an idea of where the difference is.
J-P

I'm afraid I have to disagree on that. .nib files are folders, not simple=
=20
text files. A nib folder consists of 3 parts, classes.nib, info.nib and =20
keyedobjects.nib. While the first two are text files, the second is a =20
binary file. To "debug" the .nib, use nibtool, "nibtool --help".

Basically "nibtool --classes MainMenu.nib" returns the same as in the =20
classes.nib, but you can also return all the objects, the hierarchy of th=
e =20
objects and all connections between them.

I've once built a .nib > ruby classes converter prototype, you can ask me=
=20
if you want to have a look on it.

Kash
 
J

Jaypee

Kashia said:
Hi




I'm afraid I have to disagree on that. .nib files are folders, not
simple text files. A nib folder consists of 3 parts, classes.nib,
info.nib and keyedobjects.nib. While the first two are text files, the
second is a binary file. To "debug" the .nib, use nibtool, "nibtool
--help".

Basically "nibtool --classes MainMenu.nib" returns the same as in the
classes.nib, but you can also return all the objects, the hierarchy of
the objects and all connections between them.

I've once built a .nib > ruby classes converter prototype, you can ask
me if you want to have a look on it.

Kash
You absolutely correct, I happened to have opened one of the text files.
J-P
 
A

anne001

Thank you for your help. nibtool says it can compare two nibs, but I
did not find how to do that.
I ran nibtool with -all option on both nib files, and there were nearly
hundred of objects, mainly because each menu has its associated object
apparently. And the objects did not have the same object number in both
files, so it was hard to compare unless you know what you are looking
for.

I did find that the window causing trouble was associated with the
default NSView in my file, and with a custom class in the working file.
So this is definitely a helpful tool. Thank you
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top