From: Ian J. <ian...@sp...> - 2007-12-17 01:57:26
|
Hi Rich, This seems hot off the press: http://developer.apple.com/documentation/Cocoa/Conceptual/RubyPythonCocoa/Introduction/Introduction.html Ian On 14/12/2007, at 7:50 PM, Rich Warren wrote: > I'm fairly familiar with both Ruby and Cocoa, but I've never really > played around with RubyCocoa before. I read the "Ruby and Python on > Mac OS X" article from the Apple Developer Connection, and I'm looking > for more in-depth documentation. > > I'm using the version of RubyCocoa that comes with Leopard. It seems > that the documentation is...missing? > > I found the example code at /Developer/Examples/Ruby/RubyCocoa, but > the documentation at /Developer/Documentation/RubyCocoa has only three > smallish HTML files in Japanese. > > ri doesn't seem to work for any OSX::* items. > > How do I find/load the documentation into Leopard? > > Are there any other good sources of RubyCocoa documentation? > > In particular, I'm looking for some information on CoreData and Key > Value compliance. > > In short, I have a parent entity that has a to many relationship with > a child entity. I currently display all the parents in a table. I > would like to have one column bind to the child count for each parent. > > In Cocoa, I would do this by giving the parent a transient "count" > attribute. I would then make a subclass of NSManagedObject and have > the parent use my subclass. In my subclass, I would create a - > (int_32t)count method that returned the child count. This would get > called, through the magic of KVC for my parent's count value. > > In RubyCocoa I tried the same. But it didn't work. My sample code is > below. > > require 'osx/cocoa' > > class ManagedParent < OSX::NSManagedObject > > def count() > puts "Getting The Count" > return 5 > end > end > > Yes, yes. I know. I'm not actually getting the child count. But I > wanted to get this, simpler version working before I tried to tackle > the whole valueForKey_("child") mess. > > When I run my code, I'm not getting 5 for the count, nor am I seeing > "Getting The Count" in the console. How do I get this to work? > > Thanks, > > -Rich- > > ------------------------------------------------------------------------- > SF.Net email is sponsored by: > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services > for just about anything Open Source. > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > _______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk > |