|
From: kimura w. <ki...@us...> - 2005-04-12 16:24:27
|
Thanks,
I found a bug in RubyCocoa.
This is a ad-hock patch but you will get expected results. Patch to
RBObject.m, in framework/src/objc, and rebuild RubyCocoa.
----
Index: framework/src/objc/RBObject.m
===================================================================
RCS file: /cvsroot/rubycocoa/src/framework/src/objc/RBObject.m,v
retrieving revision 1.2
diff -u -r1.2 RBObject.m
--- framework/src/objc/RBObject.m 12 Dec 2002 07:05:15 -0000 1.2
+++ framework/src/objc/RBObject.m 12 Apr 2005 14:58:37 -0000
@@ -286,8 +286,8 @@
- (BOOL)isKindOfClass: (Class)klass
{
BOOL ret;
- DLOG1("isKindOfClass(%@)", klass);
- ret = NO;
+ DLOG1("isKindOfClass(%@)", NSStringFromClass(klass));
+ ret = (klass == [RBObject class]) ? YES : NO;
DLOG1(" --> %d", ret);
return ret;
}
----
Mon, 11 Apr 2005 21:36:53 -0600, Rod Schmidt wrote:
>When I try to call __rbobj__, I get a method missing error. I think
>that is because __rbobj__ is a "C" method and is not supposed to be
>called on a ruby object. Let me explain my problem better.
>
>First, I have a profile class like this:
>
I tested your classes.
----
require 'osx/cocoa'
array = OSX::NSMutableArray.alloc.init
array.addObject(Profile.new("Taro","01-01")) # ruby object into Cocoa
controller = ProfileTableController.alloc.init
controller.addProfile(Profile.new("Ruby","02-24"))
controller.addProfile(array.objectAtIndex(0)) # -- A.
----
RubyCocoa should get instance of Profile at A. but not. I found
the function rbobj_get_ocid(), in framework/src/objc, didn't
work correctly.
>In other words the name attributes of the profile objects is not a pure
>ruby string. So, back to my original question. How do I put a pure ruby
>object in the @profiles array instead of the OCObject (the objective-C
>wrapper around the ruby object)?
>
|