Comments on: MacRuby Random Number Generator Tutorial http://foolsworkshop.com/rubycocoa/2008/06/macruby-random-number-generator-tutorial/ A weblog dedicated to development with RubyCocoa and MacRuby on OS X Sun, 07 Aug 2016 12:22:08 +0000 http://wordpress.org/?v=2.5.1 By: Michael Leung http://foolsworkshop.com/rubycocoa/2008/06/macruby-random-number-generator-tutorial/#comment-29 Michael Leung Fri, 31 Oct 2008 21:15:11 +0000 http://foolsworkshop.com/rubycocoa/?p=15#comment-29 These MacRuby screencasts are awesome. Keep 'em coming! These MacRuby screencasts are awesome. Keep ‘em coming!

]]>
By: K. M. Lawson http://foolsworkshop.com/rubycocoa/2008/06/macruby-random-number-generator-tutorial/#comment-28 K. M. Lawson Sun, 26 Oct 2008 09:02:11 +0000 http://foolsworkshop.com/rubycocoa/?p=15#comment-28 Hello Fred, I am not sure why I did that. I think NSObject is what I would I have done if I was thinking it through. Thanks! Hello Fred, I am not sure why I did that. I think NSObject is what I would I have done if I was thinking it through.

Thanks!

]]>
By: fred b. http://foolsworkshop.com/rubycocoa/2008/06/macruby-random-number-generator-tutorial/#comment-27 fred b. Sat, 25 Oct 2008 14:22:32 +0000 http://foolsworkshop.com/rubycocoa/?p=15#comment-27 Hi Konrad, many thx for your excellent idea to follow Aaron Hillegass book, I am trying to learn in parallel Cocoa/Obj-c and MacRuby. Any reason why you chose to subclass MyController from NSWindowController? I tried to stick to Aaron example, and subclassed a Foo class from NSObject, and also does the job: class Foo < NSObject attr_accessor :messages def seed(sender) t = Time.now srand t.to_i @messages.stringValue="Generated seed using time: "+t.to_s end def generate(sender) @messages.stringValue=(rand(100)+1).to_s end def awakeFromNib @messages.stringValue="Click seed first..." end end Hi Konrad, many thx for your excellent idea to follow Aaron Hillegass book, I am trying to learn in parallel Cocoa/Obj-c and MacRuby. Any reason why you chose to subclass MyController from NSWindowController? I tried to stick to Aaron example, and subclassed a Foo class from NSObject, and also does the job:

class Foo < NSObject
attr_accessor :messages
def seed(sender)
t = Time.now
srand t.to_i
@messages.stringValue=”Generated seed using time: “+t.to_s
end
def generate(sender)
@messages.stringValue=(rand(100)+1).to_s
end
def awakeFromNib @messages.stringValue=”Click seed first…”
end
end

]]>