Projects
Home     Blog     Install     New Ticket     View Tickets     Browse Source

Ticket #46 (closed defect: fixed)

Opened 9 months ago

Last modified 4 months ago

Interface Builder unable to parse new keyed arguments, fails to load class files

Reported by: apparently@… Owned by: lsansonetti@…
Priority: blocker Milestone: MacRuby 0.3
Component: MacRuby Keywords:
Cc:

Description

the MacRuby interface builder integration (carried over from RubyCocoa) is unfortunately hindered by the new keyed argument support MacRuby has for objc messaging. it is unable to parse any file making use of the keyed arguments.

i'm not sure if the library that IB uses to read files is available to our tweaking (i thought it was a script provided by the rubycocoa project but i could be mistaken), but it would be great to update it to support MacRuby.

WORKAROUND - comment out any lines that use keyed arguments, in IB manually re-read class files, it'll pull in the definitions and one can wire things up as necessary (if someone wants to create a regex to automate it please attach!). or one could redefine all of her outlets and actions. uncomment before running of course.

Change History

Changed 9 months ago by lsansonetti@…

  • milestone set to MacRuby 1.0

Changed 6 months ago by occam@…

FYI:

On my OSX 10.5, the script that updates IB can be found at:

/System/Library/Frameworks/RubyCocoa.framework/Versions/A/Tools/rb_nibtool.rb

and IB calls it something like this (e.g., on MyController.rb):

/usr/bin/ruby /System/Library/Frameworks/RubyCocoa.framework/Versions/A/Tools/rb_nibtool.rb -p -s -f - < MyController.rb

This command can be called (indirectly) from the IB menu: File->Read Class Files... and (at the file dialogue) selecting your ruby file (e.g., MyController.rb, above).

Changed 6 months ago by lsansonetti@…

  • milestone changed from MacRuby 1.0 to MacRuby 0.3

Yes, we need to rewrite rb_nibtool.rb so that it can handle the MacRuby syntax.

Changed 5 months ago by jakub.suder@…

I think IB also doesn't recognize classes that inherit (implicitly) from Object instead of NSObject (and if I understand correctly, inheriting from NSObject causes some other problems and is not recommended in MacRuby).

Changed 4 months ago by lsansonetti@…

  • status changed from new to closed
  • resolution set to fixed

As of r561, in trunk, there is now a new IB parser that replaces during install the old RubyCocoa parser.

The new parser works with both RubyCocoa and MacRuby source files. It's written in MacRuby and uses ripper.

MacRuby special notes:

1) ib_outlet(s) is deprecated, you should use attr_writer or attr_accessor to define IB outlets. 2) ib_action is deprecated, you should define methods with only one argument instead. If you want that method to appear in IB as an action, the argument must be named "sender".

Note: See TracTickets for help on using tickets.