[MacRuby-devel] [MacRuby] #194: NSOperation / NSOperationQueue#addOperation causes crash?
MacRuby
ruby-noreply at macosforge.org
Sun Jan 3 16:38:46 PST 2010
#194: NSOperation / NSOperationQueue#addOperation causes crash?
------------------------------------------+---------------------------------
Reporter: rebotfc@… | Owner: lsansonetti@…
Type: defect | Status: closed
Priority: blocker | Milestone:
Component: MacRuby | Resolution: invalid
Keywords: NSOperation NSOperationQueue |
------------------------------------------+---------------------------------
Changes (by mattaimonetti@…):
* status: new => closed
* resolution: => invalid
Comment:
When subclassing a Cocoa classes, you should not overwrite initialize.
If you want a custom initialization, it's better to follow Cocoa's
convention and create a new initializer called something like:
initWithLogger
{{{
class PageLoadOp < NSOperation
def self.initWithLogger
init
puts "testing that it works"
# don't forget to return self
self
end
end
}}}
See a real life example there:
http://github.com/mattetti/phileas_frog/blob/master/image_layer.rb#L44
By the way, thanks for giving MacRuby a try and taking the time to fill up
a bug report.
--
Ticket URL: <http://www.macruby.org/trac/ticket/194#comment:3>
MacRuby <http://macruby.org/>
More information about the MacRuby-devel
mailing list