Theocacao
Leopard
Design Element
Comment on "Objective-C, Ruby and Python for Cocoa"
by rebo — Jan 11
to configure a window instance in cocoa:

win = NSWindow.alloc.initWithContentRect [10,20,300,300],
:styleMask => (NSTitledWindowMask |
NSClosableWindowMask |
NSMiniaturizableWindowMask |
NSResizableWindowMask)

and in hotcocoa built on macruby:

win = window :frame => [10,20,300,300]

from ...http://www.macruby.org/trac/wiki/HotCocoa

So whilst you can argue that cocoa's syntax has clarity it can often be overly verbose and unnecessary.
Back to "Objective-C, Ruby and Python for Cocoa"
Design Element

Copyright © Scott Stevenson 2004-2015