[MacRuby-devel] [MacRuby] #228: Crash in my NSOutlineView data source
MacRuby
ruby-noreply at macosforge.org
Mon Mar 9 16:30:58 PDT 2009
#228: Crash in my NSOutlineView data source
--------------------------------+-------------------------------------------
Reporter: cyberfox@… | Owner: lsansonetti@…
Type: defect | Status: closed
Priority: major | Milestone:
Component: MacRuby | Resolution: invalid
Keywords: crash |
--------------------------------+-------------------------------------------
Changes (by lsansonetti@…):
* status: new => closed
* resolution: => invalid
* milestone: MacRuby 1.0 =>
Comment:
This isn't a bug in MacRuby but a bug in your code. You must always return
unique objects from the data source methods. In your
outlineView:child:ofItem: implementation you are returning new Pair
objects, this will very likely crash the outline view because it does not
retain the objects.
http://developer.apple.com/documentation/Cocoa/Conceptual/OutlineView/Articles/UsingOutlineDataSource.html#//apple_ref/doc/uid/20000725-140686
I recommend to cache the Pair objects and always return the same
instances.
--
Ticket URL: <http://www.macruby.org/trac/ticket/228#comment:3>
MacRuby <http://macruby.org/>
More information about the MacRuby-devel
mailing list