Ticket #113 (closed defect: fixed)
cocoa's automatic NSKVONotifying subclassing breaks ivars lookup
| Reported by: | lsansonetti@… | Owned by: | lsansonetti@… |
|---|---|---|---|
| Priority: | blocker | Milestone: | MacRuby 0.3 |
| Component: | MacRuby | Keywords: | |
| Cc: |
Description
$ cat foo.rb
framework 'cocoa'
class Icon
attr_accessor :name
def initialize(name)
@name = name
end
end
array_controller = NSArrayController.new
array_controller.setAvoidsEmptySelection(false)
array_controller.setPreservesSelection(false)
array_controller.setSelectsInsertedObjects(false)
array_controller.setAutomaticallyRearrangesObjects(true)
array_controller.setSortDescriptors(NSArray.arrayWithObject(NSSortDescriptor.alloc.initWithKey("name", ascending: false)))
array_controller.addObjects([Icon.new("Rich"), Icon.new("Chad")])
p array_controller.arrangedObjects[0].inspect #=> #<NSKVONotifying_Icon:0x10fc320>
p array_controller.arrangedObjects[0].name #=> nil..should not be
Change History
Note: See
TracTickets for help on using
tickets.

