From: Motohiro T. <mo...@gm...> - 2007-07-15 13:01:29
|
Hi, I'm wondering how to return simple "int" type value from Ruby code to Objective-C code. Ruby code passes Fixnum, and Objective-C code recieves NSCFNumber instead of simple int. Any suggestion ? Ruby code: class Hoge < OSX::NSObject def getInt 5 end end Objective-C code: Class helper = NSClassFromString(@"Hoge"); id hoge = [[helper alloc] init]; NSLog(@"%@ %d", [[hoge getInt] class], [(NSNumber *)[hoge getInt] decimalValue]); and those show: 2007-07-15 21:52:56.954 retval[5100] NSCFNumber 8448 thanks, -- Motohiro Takayama http://blog.deadbeaf.org/ |