From: Javier S. <jav...@ri...> - 2007-10-25 16:07:14
|
Hi again, I've noticed that when I create Ruby arrays or dictionaries that are accessed through bindings (even for read only access) are "promoted" to NSCF equivalentes, that is, for example kvc_accessor :abc . . . @abc = {} (after @abc is accessed by the gui through a binding) @abc.class OSX::NSCFDictionary This is a small nuisance perhaps, but for example, precludes me for simply doing Marshal.dump(@abc). (Of course I could always write marshal methods for NSCFDictionary, but I think that's besides the point), or doing simple checks on an object's class (since it could have mutated to the NSCF equivalent) and it gets even messier with dates. Maybe this is intended but IMHO if I store a ruby value I should always get back a Ruby value, and when Objective-C wants to read (or even set) a value the bridge should not change the class but transform it into a Ruby class. I understand that if a user keys in a string on a field that has a binding, then *perhaps* it is not so bad to get a NSCFString back, since it is not immediately obvious if I want a ruby string or an Objective-C one. However if the binding only read the value I see no justification to mutate the class. Cheers, JS |