چه کسانی این کتاب را می‌خوانند

دانشجوعلاقه‌مند یادگیری
کتابخوان حرفه‌ایلذت مطالعه
نویسندهالهام‌گیری

MacRuby in Action

Brendan G. Lim with Jerry Cheung and Jeremy McAnally

قیمت نهایی

۴۴٬۰۰۰ تومان۴۹٬۰۰۰ تومان۱۰٪ تخفیف
  • تخفیف زمان‌دار−۵٬۰۰۰ تومان

۵٬۰۰۰ تومان صرفه‌جویی نسبت به قیمت اصلی

نسخه اصلی و اورجینال

بلافاصله پس از خرید، فایل کتاب روی دستگاه شما آمادهٔ دانلود است.

تحویل فوری
پرداخت امن
ضمانت فایل
پشتیبانی

مشخصات کتاب

سال انتشار
۲۰۱۲
فرمت
PDF
زبان
انگلیسی
حجم فایل
۱۹٫۶ مگابایت

دربارهٔ کتاب

For developers who have learned the elegant and highly productive Ruby language, it can be a real drag to switch back to a traditional static programming tool like Objective-C. MacRuby, a Ruby 1.9 implementation that sits directly on the Mac OS X core, gives Rubyists the potential to code Cocoa apps without sacrificing the language features they've come to depend on. __MacRuby In Action__ is a tutorial for Ruby developers who want to code for OS X without learning Objective-C. Readers will learn the ins and outs of the MacRuby language, including straightforward examples of creating OS X applications using Cocoa components. The core of the book is an example-driven tour of the Cocoa framework from the Ruby perspective that focuses on getting things done. MacRuby-front 1 brief contents 6 contents 8 preface 14 acknowledgments 15 about this book 17 Who should read this book 17 Roadmap 18 Code conventions 19 Software requirements 19 Author Online 19 about the authors 20 about the cover illustration 21 Part 1 Starting with MacRuby 22 1 Introducing MacRuby 24 1.1 Introducing MacRuby 25 1.1.1 The MacRuby difference 25 1.1.2 Setting up your environment 26 1.1.3 Hello World, part 1 27 1.2 Cocoa: What you need to know 28 1.2.1 Important classes and concepts 29 1.2.2 How Cocoa implements common design patterns 31 1.3 Objective-C and Ruby: what you need to know 32 1.3.1 A shared heritage 33 1.3.2 Objective-C 101 34 1.3.3 Ruby 101 38 1.4 Diving into MacRuby 42 1.4.1 Class structure 42 1.4.2 Creating MacRuby classes 44 1.4.3 Syntax and method signatures 45 1.4.4 Using Ruby and Objective-C methods 47 1.4.5 Creating user interfaces 48 1.5 Hello World, part 2 49 1.5.1 Creating an Xcode project 50 1.5.2 Creating the interface 51 1.5.3 Creating the controller 53 1.5.4 Connecting the interface and controller 55 1.6 Summary 56 2 Using Macirb and the Apple development tools 58 2.1 Using external libraries with MacRuby 59 2.1.1 Loading frameworks 59 2.1.2 Loading Objective-C libraries as bundles 60 2.1.3 Loading Ruby gems 62 2.2 Exploring Macirb 63 2.2.1 Comparing the Ruby and MacRuby consoles 63 2.2.2 Working in the MacRuby console 64 2.2.3 Macirb tips and tricks 64 2.3 Building a Pomodoro application in Xcode 68 2.3.1 Creating a new MacRuby project 68 2.3.2 Constructing the interface 71 2.3.3 Creating the controller 74 2.3.4 Connecting the controller and the interface 77 2.3.5 Running the application 79 2.3.6 Releasing the application 79 2.4 Summary 84 3 Going beyond the basics with Xcode Interface Builder 85 3.1 About Interface Builder 86 3.1.1 History of Interface Builder 86 3.1.2 Getting around Interface Builder 86 3.2 Creating connections 90 3.2.1 Understanding outlets 90 3.2.2 Understanding actions 92 3.3 Creating the Todo List application 94 3.3.1 Constructing the user interface 94 3.3.2 Creating the model 100 3.3.3 Creating the controller 100 3.3.4 Connecting outlets and actions 103 3.3.5 Running and packaging the application 104 3.4 Summary 105 Part 2 Take it for a spin 106 4 Using the delegate pattern 108 4.1 What are delegates? 109 4.1.1 How do delegate methods work? 109 4.1.2 Implementing the delegate pattern 110 4.2 Delegation as an extension technique 113 4.2.1 Delegation the Cocoa way 114 4.2.2 Delegation using Forwardable 114 4.3 Using delegation in a custom MacRuby web browser 115 4.3.1 Creating the browser interface 115 4.3.2 Setting up the controller 116 4.3.3 Implementing delegate methods in the controller 119 4.3.4 Connecting outlets and actions 121 4.3.5 Taking MacRuby Browser for a spin 123 4.4 Summary 124 5 Notifications and implementing the observer pattern 125 5.1 Notifying multiple objects 126 5.1.1 When to use notifications 126 5.1.2 Managing notifications 127 5.2 Setting up notifications 128 5.2.1 Creating notifications 129 5.2.2 Posting notifications to the notification center 129 5.3 Queuing notifications 130 5.3.1 Using posting styles 130 5.3.2 Coalescing notifications 131 5.3.3 Queuing multiple notifications 133 5.3.4 Removing notifications 134 5.4 Responding to notifications 135 5.4.1 Adding notification observers 135 5.4.2 Removing notification observers 137 5.5 Building an iTunes-notification observer 137 5.5.1 Creating the script 137 5.5.2 Running the script 139 5.6 Summary 139 6 Using key-value coding and key-value observing 141 6.1 Simplifying code with key-value coding 142 6.1.1 Accessing object properties with KVC 142 6.1.2 Handling unknown keys 144 6.1.3 Understanding key paths and collection operators 146 6.2 Using KVO to implement observers 149 6.2.1 Adding and removing observers 149 6.2.2 Manually notifying observers of changes 150 6.2.3 Responding to observed objects 151 6.3 Building out the Product Inventory application 152 6.3.1 Creating the user interface 152 6.3.2 Using KVC to retrieve product information 153 6.3.3 Adding features with KVC and KVO 158 6.4 Summary 161 7 Implementing persistence with Core Data 162 7.1 Introducing Core Data 163 7.1.1 Core Data concepts 163 7.1.2 Differences between Core Data and traditional databases 163 7.1.3 Creating a base Core Data project 164 7.2 Understanding the persistent store and managed objects 166 7.2.1 Anatomy of a persistent store 167 7.2.2 Working with the managed object model 168 7.2.3 Working with entity properties 170 7.2.4 Defining a managed object class 173 7.3 Working with managed objects 175 7.3.1 Creating managed objects and updating properties 175 7.3.2 Persisting changes to managed objects 176 7.4 Retrieving objects from Core Data 178 7.4.1 Filtering and sorting with predicates and descriptors 178 7.4.2 Fetching objects from Core Data 179 7.5 Creating a Core Data version of the Todo List application 181 7.5.1 Building the user interface 181 7.5.2 Creating the tasks controller 182 7.5.3 Connecting the interface to the controller 185 7.5.4 Running the application and inspecting the persistent store 187 7.6 Summary 188 8 Core Animation basics 189 8.1 Introduction to Core Animation 190 8.1.1 What is Core Animation? 190 8.1.2 Class structure 190 8.1.3 Core Animation鈥檚 rendering architecture 191 8.1.4 Creating a basic animation with Cocoa Animation 192 8.2 Core Animation layers 194 8.2.1 Layer coordinate systems 195 8.2.2 Layer geometry 195 8.2.3 Layer content 196 8.3 Animating with Core Animation 200 8.3.1 Basic animations 200 8.3.2 Keyframe animations 202 8.3.3 Grouping animations 203 8.4 Summary 206 Part 3 MacRuby extras 208 9 HotCocoa 210 9.1 Introducing HotCocoa 210 9.1.1 Getting started 211 9.2 Built-in mappings 212 9.2.1 Applications and menus 212 9.2.2 Windows and controls 214 9.2.3 More advanced layouts 219 9.3 Building a speech application using HotCocoa 221 9.3.1 Laying out the views 221 9.3.2 Making your application speak to you 222 9.4 Summary 223 10 MacRuby testing 224 10.1 Testing MacRuby applications with MiniTest 224 10.2 Installing and configuring MiniTest 226 10.3 Application vs. logic testing 228 10.4 Where to start testing 230 10.4.1 Application initialization 230 10.4.2 Core Data 231 10.4.3 Managing persistence store for testing 233 10.4.4 Testing predicates 235 10.5 Summary 236 11 MacRuby and the Mac App Store 237 11.1 Introducing the Mac App Store 238 11.1.1 Benefits of releasing on the Mac App Store 238 11.1.2 Limitations of the Mac App Store 239 11.2 Knowing the App Store rules 240 11.2.1 Functionality 240 11.2.2 Metadata 240 11.2.3 Location 240 11.2.4 User interface 240 11.2.5 Privacy 241 11.2.6 Charities and contributions 241 11.2.7 Legal requirements 241 11.3 Submitting a MacRuby application 241 11.3.1 Creating certificates 241 11.3.2 Registering your Mac App ID 244 11.3.3 Preparing icons and screenshots 245 11.3.4 Adding your application to iTunes Connect 246 11.3.5 Packaging and submitting your application 248 11.3.6 Dealing with application rejection 252 11.3.7 Submitting an update 252 11.4 Summary 252 appendix A: Scripting with MacRuby 253 A.1 Before, there was AppleScript 253 A.1.1 Introduction to AppleScript 254 A.1.2 AppleScript dictionaries 255 A.2 MacRuby scripting 256 A.2.1 Creating a BridgeSupport file 256 A.2.2 Controlling iTunes With MacRuby 257 A.2.3 Updating your iChat status 259 index 262 Symbols 262 A 262 B 262 C 263 D 264 E 264 F 264 H 264 I 264 J 265 K 265 L 265 M 265 N 266 O 267 P 267 R 268 S 268 T 268 U 268 V 268 W 268 X 269 MacRuby-back 270

Summary

MacRuby in Action is a tutorial for Ruby developers who want to code for Mac OS X without learning Objective-C. You'll learn the ins and outs of the MacRuby language, including straightforward examples of creating OS X applications using Cocoa components.

About the Technology

For Rubyists, it's a real drag switching to a static language like Objective-C for Mac development. Fortunately, you don't have to. MacRuby is a Ruby 1.9 implementation that sits right on the Mac OS X core. It gives you access to the Cocoa framework and easy interoperability with the Mac platform.

About the Book

MacRuby in Action teaches Ruby developers how to code OS X applications in Ruby. You'll explore key Cocoa design patterns, along with a few twists that MacRuby makes possible. You'll also pick up high-value techniques including system scripting, automated testing practices, and getting your apps ready for the Mac App Store.

Written for Rubyists. No experience with Cocoa, Objective-C, or Mac OS X required.

Purchase of the print book comes with an offer of a free PDF, ePub, and Kindle eBook from Manning. Also available is all code from the book.

What's Inside

  • Intro to Mac OS X development
  • Full coverage of the Cocoa framework
  • MacRuby for iOS

Table of Contents

  1. PART 1 STARTING WITH MACRUBY
  2. Introducing MacRuby
  3. Using Macirb and the Apple development tools
  4. Going beyond the basics with Xcode Interface Builder
  5. PART 2 TAKE IT FOR A SPIN
  6. Using the delegate pattern
  7. Notifications and implementing the observer pattern
  8. Using key-value coding and key-value observing
  9. Implementing persistence with Core Data
  10. Core Animation basics
  11. PART 3 MACRUBY EXTRAS
  12. HotCocoa
  13. MacRuby testing
  14. MacRuby and the Mac App Store
MacRuby in Action is a tutorial for Ruby developers who want to code for Mac OS X without learning Objective-C. You'll learn the ins and outs of the MacRuby language, including straightforward examples of creating OS X applications using Cocoa components. About the Technology For Rubyists, it's a real drag switching to a static language like Objective-C for Mac development. Fortunately, you don't have to. MacRuby is a Ruby 1.9 implementation that sits right on the Mac OS X core. It gives you access to the Cocoa framework and easy interoperability with the Mac platform. About this Book MacRuby in Action teaches Ruby developers how to code OS X applications in Ruby. You'll explore key Cocoa design patterns, along with a few twists that MacRuby makes possible. You'll also pick up high-value techniques including system scripting, automated testing practices, and getting your apps ready for the Mac App Store. Written for Rubyists. No experience with Cocoa, Objective-C, or Mac OS X required. What's Inside Intro to Mac OS X development Full coverage of the Cocoa framework MacRuby for iOS About the Author Brendan G. Lim is a professional Ruby and Objective-C developer specializing in Rails and mobile development. Jerry Cheung is a Rails engineer working with emerging technologies like MacRuby and Node.js. Jeremy McAnally is a web and mobile developer and coauthor of Ruby in Practice

قیمت نهایی

۴۴٬۰۰۰ تومان