|
From: Jonathan P. <jp...@dc...> - 2006-02-17 23:52:32
|
On 17 Feb 2006, at 14:53, Hunter Kelly wrote: > For example, I opened up the simpleapp example. Interface Builder can > "see" AppController and MyView. However, in XCode, if I create a new > Ruby subclass of NSObject, I can't figure out how to tell Interface > Builder about this new class. If it were Obj-C, I'd just drag the .h > file onto Interface Builder, but when I try that with the .rb file > Interface Builder flicks over to the sounds tab or something. > > What do I need to be able to do to make Interface Builder aware of my > Ruby classes? You can do it manually in Interface Builder. You need to create a =20 subclass of NSObject with the appropriate name, and then instantiate =20 it. This is described in the Interface Builder help. I've pasted a =20 fragment of it below. You'll have to add the actions and outlet names =20= manually too. Hope that helps, Jonathan Creating a Class To create a class that inherits from a Coca class, follow the steps =20 in each of these sections, in order: =93Subclass an existing class.=94 =93Add actions and outlets to the new class.=94 =93Create an instance of the new class.=94 =93Connect the class=92s actions and outlets.=94 =93Generate the class=92s source code files.=94 Subclass an existing class. In the Classes pane of the nib file window, Control-click the class =20 you want your class to inherit from, and choose Subclass from the =20 menu that appears. A new subclass is added with a default name. Type =20 in a new name for the subclass. ... |