[MacRuby] #917: NSKeyedArchiver fails to find a superclass's implementation of 'encodeWithCoder:'
#917: NSKeyedArchiver fails to find a superclass's implementation of 'encodeWithCoder:' ---------------------------------+------------------------------------------ Reporter: mred@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Keywords: ---------------------------------+------------------------------------------ NSKeyedArchiver fails to find a superclass's implementation of 'encodeWithCoder:' when its objects are encoded in a particular order. When the code excerpted below is run: {{{ class ArchiverDelegate def archiver archiver, willEncodeObject:object puts "willEncode #{object.class}" object end end def test_archiver graph = Graph.new a = A.new graph.addNode a b = B.new graph.addNode b b.connect a data = NSMutableData.alloc.init archiver = NSKeyedArchiver.alloc.initForWritingWithMutableData data delegate = ArchiverDelegate.alloc.init archiver.setDelegate delegate archiver.encodeObject graph, forKey:'root' archiver.finishEncoding end 10.times do |i| puts i test_archiver end }}} I get results such as this: {{{ $ macruby test-archiver.rb 0 willEncode Graph willEncode NSCFSet willEncode A willEncode B willEncode Connection 1 willEncode Graph willEncode NSCFSet willEncode B willEncode Connection willEncode A /Users/ehynes/ClockSmith/current/Test/hgignore/test-archiver.rb:1:in `<main>': super: no superclass method `encodeWithCoder' for #<A:0x2000cc160> (NoMethodError) }}} The NoMethodError occurs whenever B is encoded before A. Attached is the complete code example. -- Ticket URL: <http://www.macruby.org/trac/ticket/917> MacRuby <http://macruby.org/>
#917: NSKeyedArchiver fails to find a superclass's implementation of 'encodeWithCoder:' ---------------------------------+------------------------------------------ Reporter: mred@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: MacRuby 1.0 Component: MacRuby | Keywords: ---------------------------------+------------------------------------------ Changes (by lsansonetti@…): * milestone: => MacRuby 1.0 Comment: For 1.0. -- Ticket URL: <http://www.macruby.org/trac/ticket/917#comment:1> MacRuby <http://macruby.org/>
#917: NSKeyedArchiver fails to find a superclass's implementation of 'encodeWithCoder:' ---------------------------------+------------------------------------------ Reporter: mred@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: MacRuby 1.0 Component: MacRuby | Keywords: ---------------------------------+------------------------------------------ Comment(by lsansonetti@…): This is a problem in the super dispatcher. The current super class is usually saved and restored within the dispatcher, however encodeWithCoder: is being called from Objective-C. -- Ticket URL: <http://www.macruby.org/trac/ticket/917#comment:2> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby