|
From: Steven A. <st...@ne...> - 2005-08-22 16:45:36
|
Hello,
I am writing a dictionary application in RubyCocoa. I have an object
that looks like this:
class DictDelegate < OSX::NSObject
include OSX
ib_outlets :acceptsAction, :acceptsObject, :acceptsQuality, :affixPositi
on,
:affixProduces, :comments, :definition, :examples, :sea
rchBar,
:synonyms, :window, :word, :wordList, :wordtype, :condi
tions
def getFormValues
# Return a hash of the values of the form.
{'word'=>@word.stringValue.to_s,
'wordtype'=>@wordtype.stringValue.to_s,
'definition'=>@definition.string.to_s,
'comments'=>@comments.string.to_s,
'acceptsAction'=>@acceptsAction.state,
'acceptsObject'=>@acceptsObject.state,
'acceptsQuality'=>@acceptsQuality.state,
'affixPosition'=>@affixPosition.stringValue.to_s,
'affixProduces'=>@affixProduces.stringValue.to_s}
end
end
When I call self.getFormValues, I do not get back a Ruby Hash, but
rather a Cocoa NSCFDictionary. Right before the return, it's a
hash....but when it gets back, it's an NSCFDictionary.
It would be far more convenient for me to get back the actual object
I returned. The auto-conversion behavior is not convenient. Is
there a way to get around this? Is this a bug?
I am running the current CVS version of rubycocoa. I'm on Mac OS X
Tiger 10.4.2 on a dual 2.5GHz with four GB of RAM.
steve
|