[MacRuby] #916: NSKeyedArchiver/Unarchiver generates multiple copies of the same object
MacRuby
ruby-noreply at macosforge.org
Wed Sep 22 20:28:28 PDT 2010
#916: NSKeyedArchiver/Unarchiver generates multiple copies of the same object
---------------------------------+------------------------------------------
Reporter: mred@… | Owner: lsansonetti@…
Type: defect | Status: new
Priority: major | Milestone:
Component: MacRuby | Keywords:
---------------------------------+------------------------------------------
{{{
$ cat test.rb
class A
attr_accessor :a
def initWithCoder coder
@a = coder.decodeObjectForKey 'a'
self
end
def encodeWithCoder coder
coder.encodeObject @a, forKey:'a'
end
end
a = A.new
b = A.new
a
b.a = a
puts(a == b.a)
data = NSKeyedArchiver.archivedDataWithRootObject a
a = NSKeyedUnarchiver.unarchiveObjectWithData data
puts(a == b.a)
$ macruby test.rb
true
false
}}}
--
Ticket URL: <http://www.macruby.org/trac/ticket/916>
MacRuby <http://macruby.org/>
More information about the macruby-tickets
mailing list