From: Brian M. <ma...@ex...> - 2008-08-27 14:15:15
|
On Aug 27, 2008, at 12:04 AM, Allison Newman wrote: > In my (admittedly limited) experience with RubyCocoa, the bug most > likely to make the internals of Cocoa blow up is when you hand Cocoa > a Ruby Object that has been generated by a factory class. My > personal favourite of these is objects generated by YAML, but I'm > sure there are others. > > Is your problem always associated with NSNotificationCenter? How > are you generating the observer objects? Can you post that code? The interesting thing here is that I'm not causing the notification to be sent. It's happening on a mouse-down. None of my code observes those notifications. Here's the code that manages the combo boxes. It's in a controller (loaded from main nib). It talks to a class that loads-and-decodes user preferences. (Not using NSUserDefaultsController yet.) def awakeFromNib @comboBox.usesDataSource = true @comboBox.dataSource = self @comboBox.stringValue = @preferences.display_name_of_favorite_translator super end # In role as data source def numberOfItemsInComboBox(ignored) @preferences.translator_display_names.size end def comboBox_objectValueForItemAtIndex(ignored, index) @preferences.translator_display_names[index] end def comboBox_indexOfItemWithStringValue(ignored, string) @preferences.translator_display_names.index(string) || NSNotFound end ----- Brian Marick, independent consultant Mostly on agile methods with a testing slant www.exampler.com, www.exampler.com/blog, www.twitter.com/marick |