Programming Cocoa with Ruby: Create Compelling Mac Apps by Brian Marick

By Brian Marick

This can be a booklet for the Ruby programmer who is by no means written a Mac app prior to. via this hands-on instructional, you are going to research all in regards to the Cocoa framework for programming on Mac OS X. subscribe to the author's trip as this skilled Ruby programmer delves into the Cocoa framework correct from the start, answering an identical questions and fixing a similar difficulties that you're going to face. jointly you are going to construct a unmarried program that threads in the course of the publication, and it isn't a toy. you are going to disguise issues that won't be the flashiest components of Cocoa, yet they are ones you have to to grasp to create powerful, feature-rich functions for your self. and you may examine greater than simply Cocoa and RubyCocoa, you will get first-hand potent agile improvement practices. you will see test-first improvement of user-interface code, little domain-specific languages that reap the benefits of Ruby good points, and different Rubyish methods. on the finish of the ebook, you may be able to write a true Mac OS X program that may be allotted to genuine clients.

Show description

Read Online or Download Programming Cocoa with Ruby: Create Compelling Mac Apps Using RubyCocoa (The Facets of Ruby Series) PDF

Best programming: programming languages books

Designing components with the C++ STL

'This e-book is the main actual and updated resource of data at the STL presently on hand. .. It has an strategy and allure of its personal: it explains recommendations for development facts buildings and algorithms on most sensible of the STL, and during this means appreciates the STL for what it's - a framework. ' - Angelika Langer, self sufficient advisor and C++ document Columnist"A fantastically authored therapy of the STL.

ppk on JavaScript: Modern, Accessible, Unobtrusive JavaScript Explained by Means of Eight Real-World Example Scripts

Even if you are an old-school scripter who must modernize your JavaScripting abilities or a standards-aware internet developer who wishes most sensible practices and code examples, you are going to welcome this advisor from a JavaScript grasp. different JavaScript books use instance scripts that experience little pertaining to real-world internet improvement and are necessary in simple terms within the bankruptcy to hand.

Programming Cocoa with Ruby: Create Compelling Mac Apps Using RubyCocoa (The Facets of Ruby Series)

This can be a e-book for the Ruby programmer who is by no means written a Mac app prior to. via this hands-on educational, you will examine all concerning the Cocoa framework for programming on Mac OS X. sign up for the author's trip as this skilled Ruby programmer delves into the Cocoa framework correct from the start, answering an analogous questions and fixing an identical difficulties that you're going to face.

Extra resources for Programming Cocoa with Ruby: Create Compelling Mac Apps Using RubyCocoa (The Facets of Ruby Series)

Sample text

Delegation vs. Notification You have now seen two different code designs for window closing. You might ask, which is better? Since they both do the same thing, I embrace my inner slacker and ask two questions: • Which is less work today? • Which will be less work in the future? I personally place more weight on the first question because I get its answer right more often. Setting a delegate requires drawing a line in Interface Builder. Adding a notification means typing code in awakeFromNib. For me, delegation wins.

A small quirk: unlike the delegate messages you’ve seen so far, applicationShouldTerminate takes an NSApplication as its argument, so sender or app would be a better name than aNotification. 4 An Application Bundle Fine though our script may be, it doesn’t behave like a Mac application. If you double-click it, it doesn’t launch. ) It doesn’t get an icon in the Dock, you can’t see it if you Command - Tab through open applications, and so on. In this section, I’ll explain what’s special about apps.

Notice that they are both NSTextField objects—their different appearance is entirely because of how they’re initialized. ) • What seems like a simple text view is actually its own hierarchy of objects. An NSScrollView contains the actual NSTextView and also two scrollers. One of them (the vertical scroller) takes up some space even when there’s no need for a scrollbar, but the other is invisible until it’s needed. • If there were other visible objects in the window, even ones as insignificant as a vertical line used as a separator, they’d be NSView objects too.

Download PDF sample

Rated 4.18 of 5 – based on 7 votes