9781449380373
index.html

MacRuby: The Definitive Guide

Matt Aimonetti

Teresa Horton

David Futato

Robert Romano

Jay Marchand

Karen Montgomery

Printed in the United States of America.

[LSI]

O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (http://my.safaribooksonline.com). For more information, contact our corporate/institutional sales department: (800) 998-9938 or .

Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of O’Reilly Media, Inc. MacRuby: The Definitive Guide, the image of a northern cardinal, and related trade dress are trademarks of O’Reilly Media, Inc.

Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and O’Reilly Media, Inc. was aware of a trademark claim, the designations have been printed in caps or initial caps.

While every precaution has been taken in the preparation of this book, the publisher and author assume no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein.

Revision History
2011-10-12
First release

Dedication

Pour ma fille, Giana,

Et pour ma femme, Heidi: merci pour ton soutien, tes encouragements, et ta compréhension. Sans toi, ce livre n’aurait jamais vu le jour.

Preface
The Purpose of This Book
Prerequisites
Conventions Used in This Book
Using Code Examples
Safari® Books Online
How to Contact Us
Acknowledgments
I. MacRuby Overview
1. Introduction
Introducing MacRuby
Why MacRuby?
Installation
Mac OS X
Xcode
MacRuby
Code Example
Loading a Framework
Using Classes
Defining a Class and Its Methods
Ruby Class Instantiation
Methods
Documentation
The Interactive Ruby Shell
Syntactic Sugar
2. Fundamentals
Run Loops
Callbacks/Delegation
User Inputs
Outlets
Display
Example
3. The Cocoa Environment
History
Main Frameworks in the Cocoa API
Foundation Framework
AppKit Framework
CoreData Framework
Reference Library
Central Panel
Sidebar
Mutability
4. Foundation
Compatibility Table
Strings and Attributed Strings
Arrays
Hashes/Dictionaries
Sets
Enumerators
Date, Time, and Calendars
NSDate
NSCalendar
Data
Locales
Time Zones
Exceptions
I/O
URLs/Requests/Connections
Cache Policy and Cache Access
Asynchronous Versus Synchronous
Pipes
File Handles
Bundles
Scheduling
Run Loops
Timers
Tasks/Subprocesses
Threads
Operations/Operation Queues
Notifications
Notification Centers
Notification Queues
Archiving and Serialization
Miscellaneous Classes
XML Parsing
Filtering/Logical Conditions
Undo/Redo
User’s Preferences
5. Application Kit
Cocoa Key Principles
Model-View-Controller Design Pattern
Protocols
Key-Value Coding
Bindings
Delegation
User Interface
Windows, Views, and Cells
Positioning
Events and the Responder Chain
Drawing
Graphics Context
Images
6. Xcode
Xcode IDE
Template
Navigator Area
Editor Area
Debug Area
Utility Area
7. Core Data
Data Model
The Data Model and the Entity
Adding Attributes
Relationships
Setting Up Controllers
User Interface
Movies
Art Cover
Actors
Search
Persistence
Managed Object Model
Managed Object Context
Persistent Store Coordinator
Workflow
8. One Step Deeper
Selectors
Blocks
Concurrency
Grand Central Dispatch
Sandboxing
Using Objective-C or C Code
Scriptable Applications
Method Missing
Pointers
Void Pointers
Unsigned Pointer
Compilation
Compilation Within Xcode
II. MacRuby in Practice
9. Address Book Example
User Interface
Address Book
Web API Call
Cleaning Up: Better Management of Widgets
The Extra Mile: Displaying More Information Through Notifications
10. Geolocation
User Interface
Table View
Core Location
Web API
11. MacRuby in Objective-C Projects
API
Usage
Example in an Xcode Project
User Interface
Using the MacRuby Method
12. Objective-C Code in MacRuby Apps
Dynamic Library
Framework
BridgeSupport
13. Using Ruby Third-Party Libraries
RubyGems
MacRuby Deploy
Index
Site last updated on: November 9, 2011 at 10:00:57 AM PST