By Brian Marick

This can be a e-book for the Ruby programmer who is by no means written a Mac app sooner than. via this hands-on educational, you are going to research 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. jointly you are going to construct a unmarried program that threads during the booklet, and it isn't a toy. you will conceal themes that will not be the flashiest components of Cocoa, yet they're ones you have to to understand to create powerful, feature-rich purposes for your self. and you may research greater than simply Cocoa and RubyCocoa, you will get first-hand powerful agile improvement practices. you will see test-first improvement of user-interface code, little domain-specific languages that benefit from Ruby gains, and different Rubyish methods. on the finish of the e-book, you can be able to write a true Mac OS X program that may be dispensed to genuine clients.

Show description

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

Similar programming: programming languages books

Essential Java Fast : How to write object oriented software for the Internet

Java is a brand new and interesting object-oriented programming language that is set to rework the realm vast net. Java permits clients to jot down functions which might be accessed throughout diversified structures and offers a good technique of development small yet robust courses that let a tremendous variety of recent purposes - corresponding to animation, stay updating, two-way interactions and so forth.

Designing SQL Server 2000 Databases. for .Net ™ Enterprise Servers

The Microsoft . internet initiative is the way forward for e-commerce - making it attainable for corporations to construct a safe, trustworthy e-commerce infrastructure. this can be the 1st publication to stipulate the features of SQL Server 2000, one of many key parts of . web. SQL Server 2000 introduces robust new info mining performance designed particularly to catch and procedure consumer profiles and to foretell destiny paying for styles on e-commerce websites.

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

Sample text

Then you see all notifications from all objects. Try that to see how many notifications are sent in even the simplest Cocoa applications. ) userInfo arguments If you tried the change in the previous paragraph, you probably saw output with extra information. 00} ; NSTextMovement = 16; }} Each notification can pass along an NSDictionary. NSDictionary is Cocoa’s equivalent of Ruby’s Hash: a collection of key/value pairs. When printed, an NSDictionary looks something like a hash, but not exactly. Keys and values are separated by =,, not =>, and strings aren’t enclosed in quotes.

Interface Builder is a tool for drawing executable user interfaces. Begin by creating a project. Start Xcode (in /Developer/Applications). If you see a Welcome page, dismiss it (although you may want to look at it later). Create a project by selecting File > New Project. You’ll see a screen like this: Choose, as I did in the figure, a Cocoa-Ruby application, and hit Next. You’ll be asked to name the project. Since you’re also naming the app, it’s conventional to pick a capitalized name. 0 printing, July 2009) 38 T HE B ASICS After you hit Finish, you’ll see something like the following: This view has nothing to do with the file system structure of the project.

Hold that thought for a moment. ➎ replaceCharactersInRange_withString does what its name says. The absence of explicit type declarations in Ruby hides something about record. When it’s called from awakeFromNib, it’s given a plain Ruby string (class String). When it’s called from chooseApp, it’s given the stringValue of a text field, which is a Cocoa NSString. So, replaceCharactersInRange_withString is sometimes given a String and sometimes an NSString. Is that safe? If the Objective-C method replaceCharactersInRange_withString actually received a Ruby String, the result would be ugly—very ugly.

Download PDF sample

Rated 4.58 of 5 – based on 15 votes