From: Dave H. <gr...@gr...> - 2005-06-05 21:26:31
|
On Jun 4, 2005, at 4:23 PM, Jonathan Paisley wrote: > With bindings you often don't need an outlet for the text field at > all. You just have an NSString in your object bound to the text field > - Cocoa Bindings takes care of keeping the text field in sync with the > string. OK, I understand this in theory, but I'm mystified by how it'd work in practice. Where would I instantiate this particular NSString, what would it look like in Ruby, and how does it get bound to the text field? > An example for Cocoa Bindings (found using Google): Aha. Perfect example. I didn't even know that I wanted to know about 'bindings.' I note that this article says "you need to be comfortable with Xcode, Interface Builder, and have a solid understanding of Objective-C syntax in general." Oh, boy. Well, no time like the present. :) There are a lot of strange little details that I have to weedwack when connecting things up. The RubyCocoa documentation is extremely terse, so I have to figure out what Cocoa is capable of figure out which pieces of Cocoa do that figure out how they connect figure out which parts I need to be able to 'touch' figure out how to connect those parts to Ruby On the one hand, there are an amazing number of things that Cocoa sorta just 'makes happen.' That can be very cool, but it can also make it mystifying when I need to break into something that's normally automatic. Although frequently, the fact I think I need to means I haven't found the right place to plug into the excitement. <scratch head> For example, when using AppleScript Studio, for any one nib file (like, say, MainMenu.nib), I get a list of every separate AppleScript file in the project, and can connect different UI elements to different scripts. [Since I remain absolutely mystified as to how different script files can share variables, this is more or less useless to me, but I can do it.] I can't figure out how to do the equivalent activities in Ruby. The association of IB insubstantiations of custom classes appears to be quite automatic, and I haven't figured out the relationship between .nib files and .rb files yet. |