Programming Cocoa with Ruby.pdf
(
9064 KB
)
Pobierz
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
Download at Boykma.Com
What Readers Are Saying About
Programming Cocoa with Ruby
This isn’t just a book on RubyCocoa; it is probably the best book I’ve
seen that explains Cocoa technology. It actually explains how some of
the core technologies, especially bindings, work instead of just show-
ing an example of how to use them.
Allison Newman
Cocoa application developer
Learning a new API is hard enough, but learning a new API and a new
programming language at the same time can be overwhelming.
Pro-
gramming Cocoa with Ruby
is written for those of us used to a lan-
guage like Ruby or Python who want to learn about all the great stuff
Cocoa has to offer.
Jeremy McAnally
Developer, entp
The influence of Smalltalk on Ruby and Objective-C is considerable.
It shouldn’t be a surprise then that Cocoa, whose native tongue is
Objective-C, can be effectively learned and programmed from Ruby
in a way that captures the succinctness and expressiveness of this
newly popular scripting language. Brian’s book is a great introduc-
tion to the agile development of Cocoa apps, it serves as a primer on
Cocoa, and it demonstrates sound and thoughtful development prac-
tices and hygiene throughout.
Jerry Kuch
Principal engineer, EMC Corporation
Download at Boykma.Com
Programming Cocoa with Ruby
Create Compelling Mac Apps Using RubyCocoa
Brian Marick
The Pragmatic Bookshelf
Raleigh, North Carolina
Dallas, Texas
Download at Boykma.Com
Many of the designations used by manufacturers and sellers to distinguish their prod-
ucts are claimed as trademarks. Where those designations appear in this book, and The
Pragmatic Programmers, LLC was aware of a trademark claim, the designations have
been printed in initial capital letters or in all capitals. The Pragmatic Starter Kit, The
Pragmatic Programmer, Pragmatic Programming, Pragmatic Bookshelf and the linking
g
device are trademarks of The Pragmatic Programmers, LLC.
Every precaution was taken in the preparation of this book. However, the publisher
assumes no responsibility for errors or omissions, or for damages that may result from
the use of information (including program listings) contained herein.
Our Pragmatic courses, workshops, and other products can help you and your team
create better software and have more fun. For more information, as well as the latest
Pragmatic titles, please visit us at
http://www.pragprog.com
Copyright
©
2009 Brian Marick.
All rights reserved.
No part of this publication may be reproduced, stored in a retrieval system, or transmit-
ted, in any form, or by any means, electronic, mechanical, photocopying, recording, or
otherwise, without the prior consent of the publisher.
Printed in the United States of America.
ISBN-10: 1-934356-19-0
ISBN-13: 978-1-934356-19-7
Printed on acid-free paper.
P1.0 printing, July 2009
Version: 2009-8-6
Download at Boykma.Com
Contents
1
Introduction
11
1.1
What Is Cocoa?
. . . . . . . . . . . . . . . . . . . . . . .
12
1.2
What Is RubyCocoa?
. . . . . . . . . . . . . . . . . . . .
12
1.3
What’s It Like to Learn Cocoa Using Ruby?
. . . . . . .
12
1.4
RubyCocoa? That’s
So
Last Year!
. . . . . . . . . . . . .
13
1.5
Prerequisites
. . . . . . . . . . . . . . . . . . . . . . . . .
13
1.6
Versions
. . . . . . . . . . . . . . . . . . . . . . . . . . .
15
1.7
Our Example App
. . . . . . . . . . . . . . . . . . . . . .
16
1.8
Centuries of the Bookmaker’s Art: Scorned
. . . . . . .
18
1.9
Some Terminology
. . . . . . . . . . . . . . . . . . . . .
19
1.10
Service After the Sale
. . . . . . . . . . . . . . . . . . . .
19
1.11
Solving Problems
. . . . . . . . . . . . . . . . . . . . . .
19
1.12
Acknowledgments
. . . . . . . . . . . . . . . . . . . . . .
20
2
How Do We Get This Thing Started?
22
2.1
A Program That Prints
. . . . . . . . . . . . . . . . . . .
23
2.2
Putting an Item in the Status Bar
. . . . . . . . . . . .
26
2.3
Menus
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
27
2.4
An Application Bundle
. . . . . . . . . . . . . . . . . . .
31
2.5
What Now?
. . . . . . . . . . . . . . . . . . . . . . . . . .
35
I
A First Realistic App
36
3
Working with Interface Builder and Xcode
37
3.1
The Basics
. . . . . . . . . . . . . . . . . . . . . . . . . .
38
3.2
Creating and Editing Classes in Xcode
. . . . . . . . . .
48
3.3
Debugging
. . . . . . . . . . . . . . . . . . . . . . . . . .
55
3.4
Synchronizing Interface Builder and Xcode
. . . . . . .
57
3.5
Attributes
. . . . . . . . . . . . . . . . . . . . . . . . . .
58
3.6
Overriding Window Behavior with a Delegate
. . . . . .
60
Plik z chomika:
musli_com
Inne pliki z tego folderu:
Automation through Chef Opscode_ A Hands-on Approach to Chef [Sabharwal & Wadhwa 2014-07-16].pdf
(19223 KB)
Agile Web Development with Rails (4th ed.) [Ruby, Thomas & Hansson 2011-03-31].pdf
(15246 KB)
Agile Web Development with Rails 4 [Ruby, Thomas & Hansson 2013-10-11].pdf
(12620 KB)
Crafting Rails Applications_ Everyday Practices for Everyday Rails Development [Valim 2011-04-14].pdf
(19418 KB)
Beginning Ruby on Rails E-Commerce (2006).pdf
(11824 KB)
Inne foldery tego chomika:
3D Design - Programming
ActionScript
Actionscript - Flash - Flex - Air
Ada
ADO
Zgłoś jeśli
naruszono regulamin