Projects
Home     Blog     Install     New Ticket     View Tickets     Browse Source

Ticket #113 (closed defect: fixed)

Opened 3 months ago

Last modified 3 months ago

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

Changed 3 months ago by lsansonetti@…

  • status changed from new to closed
  • resolution set to fixed

Fixed in r524/trunk.

Note: See TracTickets for help on using tickets.