[MacRuby] #575: Bug in Cocoa bindings for NSTableViewColumn + NSArrayController
#575: Bug in Cocoa bindings for NSTableViewColumn + NSArrayController -----------------------------+---------------------------------------------- Reporter: ninh@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: MacRuby 0.5 Component: MacRuby | Keywords: -----------------------------+---------------------------------------------- When an NSTableViewColumn has a subclass of NSTextFieldCell as its data cell, and when the column is bound to an NSArrayController, then when I add data to that array controller, it is expected that the arrangedObject of the array controller will set the datacell's objectValue property accordingly. The latter only seems to work for NSMutableDictionary strangely (maybe other cases too, but have only tested this one in particular) but not for other custom objects. When querying for the objectValue from within my subclass of NSTextFieldCell, I do however see that objectValue is set to an object of the right type, but its object id keeps changing during the draw cycle: I don't think that should be the case either as the objects in the arraycontroller should correspond to those in the datacell's objectValue. Also, objectValue's properties seem to be nil. This basically prevent people from using Cocoa bindings with NSTableViewColumns and custom objectValue's. -- Ticket URL: <http://www.macruby.org/trac/ticket/575> MacRuby <http://macruby.org/>
#575: Bug in Cocoa bindings for NSTableViewColumn + NSArrayController -----------------------------+---------------------------------------------- Reporter: ninh@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: blocker | Milestone: Component: MacRuby | Resolution: invalid Keywords: | -----------------------------+---------------------------------------------- Changes (by lsansonetti@…): * status: new => closed * resolution: => invalid * milestone: MacRuby 0.5 => Comment: After quick investigation and talk with Ninh, it turns out that making the MyCustomObject class compliant to the NSCopying protocol fixes the problem. Since it does not seem to be a problem with MacRuby itself, I'm closing the bug. -- Ticket URL: <http://www.macruby.org/trac/ticket/575#comment:1> MacRuby <http://macruby.org/>
#575: Bug in Cocoa bindings for NSTableViewColumn + NSArrayController -----------------------------+---------------------------------------------- Reporter: ninh@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: blocker | Milestone: Component: MacRuby | Resolution: invalid Keywords: | -----------------------------+---------------------------------------------- Comment(by eloy.de.enige@…): @ninh Ah, I should have told you that :) I wonder, wouldn't it be feasible to make all Ruby objects do a dup/clone kind of operation by default? Something like: {{{ def copyWithZone(zone) copy = self.class.allocWithZone(zone).init instance_variables.each { |ivar| copy.instance_variable_set ivar, instance_variable_get(ivar) } copy end }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/575#comment:2> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby