[MacRuby] #1322: Xcode 4.1/4.2

MacRuby ruby-noreply at macosforge.org
Thu Aug 4 10:03:23 PDT 2011


#1322: Xcode 4.1/4.2
----------------------------------------+-----------------------------------
 Reporter:  d.dagostino@…               |       Owner:  lsansonetti@…        
     Type:  defect                      |      Status:  new                  
 Priority:  blocker                     |   Milestone:                       
Component:  MacRuby                     |    Keywords:                       
----------------------------------------+-----------------------------------

Comment(by paolo.bosetti@…):

 Hi all,
 After some testing, I just wanted to clarify my workaround.

 If your ruby window delegate class is named AppController, create a new
 Obj-C class named AppController, subclass of NSObject and conforming to
 NSApplicationDelegate protocol. Its interface file should be like this:

 {{{
 @interface AppDelegate : NSObject <NSApplicationDelegate> {
 }
 @end
 }}}

 At this point, open side by side the nib file and the interface file (.h),
 add controls to the window, then control-drag from controls to the
 interface file. On the popover, choose action or outlet and give it the
 name.

 Now click on the project entry on the leftmost tree in Xcode window,  and
 duplicate the target of your app. Call the duplicate "Workaround". In the
 target settings, under "build phases", REMOVE the AppDelegate.m file from
 the Compile Sources list.

 At this point, you simply have to switch to the "Workaround" target when
 you have to add/edit outlets or actions to your nib, then switch back to
 the main target, and edit accordingly the ruby interface file, i.e. add
 the same action methods and the same attar_accessor you defined in the
 Obj-C interface file. Essentially, you have two targets, one only used for
 nib setup (which includes the Obj-C files), and one used for ruby
 development and testing.

 I did a few tests and It seems to work fine. It is also easier than having
 a second virtualized SL installation as suggested by shaun. This should
 also answer to scott's objection.

 Cheers,
 -P.

-- 
Ticket URL: <http://www.macruby.org/trac/ticket/1322#comment:27>
MacRuby <http://macruby.org/>



More information about the macruby-tickets mailing list