#194: NSOperation / NSOperationQueue#addOperation causes crash?
------------------------------------------+---------------------------------
Reporter: rebo...@… | Owner: lsansone...@…
Type: defect | Status: closed
Priority: blocker | Milestone:
Component: MacRuby | Resolution: invalid
Keywords: NSOperation NSOperationQueue |
------------------------------------------+---------------------------------
Changes (by mattaimone...@…):
* 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/>
_______________________________________________
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel