Learn Objective-C Java Developers

Learn Objective-C Java Developers

CYAN YELLOW SPOT MATTE MAGENTA BLACK PANTONE 123 C BOOKS FOR PROFESSIONALS BY PROFESSIONALS® Companion eBook Available Turn Java Expertise into Mac OS X • Learn Objective-C, the language of native Mac and iPhone apps, by leveraging Objective-CLearn the Java programming skills you already have. and iPhone App Productivity • Learn to use Apple’s development environment, including just enough Cocoa and Xcode. It’s the professional’s express route to Mac and iPhone developer proficiency. • Learn by working through the exercises and then keep returning for reference and further study. You’ll find everything conveniently organized so you can reference techniques by design pattern. e all love Java, but Mac OS X is looking awfully cool these days and iPhone OS de- Wvelopment is the most exciting new environment since, well…, since Java! If only there were a way to avoid learning objective-C. If you’re a Javahead, you probably know a lot more about objective-C than you think. The two languages are full of similarities and that’s why we’ve published Learn Objective-C for Java Developers, your shortcut to Mac and iphone development productivity. Both languages are object-oriented, use similar inheritance models, string classes, garbage collection, serialization, threads, introspection, and communications. They also embrace proven design patterns like Model-View-Controller and property accessors. You’re already a for good portion of the way there and you haven’t even opened this book! We’ll show you how to use what you know about Java to understand and become quickly Developers Java proficient in Objective-C. Most important, we’ll show you how to take advantage of features unique to Objective-C and incorporate them into your designs. Don’t waste your hard-earned Java knowledge by starting over in kindergarten. Move yourself to the head of the class and catapult over the Objective-C learning curve. You’ll be writing Mac OS X and iPhone apps faster than you ever imagined possible. James Bucanek has over 25 years of experience in software and systems development. Having made the transition to Mac OS X many years ago, he has never looked back. Learn Objective-C for Java Developers RELATED TITLES Bucanek James Bucanek COMPANION eBOOK SEE LAST PAGE FOR DETAILS ON $10 eBOOK VERSION ISBN 978-1-4302-2369-6 53999 US $39.99 Shelve in Mac Development SOURCE CODE ONLINE User level: www.apress.com Intermediate–Advanced 9 781430223696 this print for content only—size & color not accurate Trim: 7.5 x 9.25 spine =0.96875" 520 page count Download at WoweBook.Com ■ CONTENTS Learn Objective-C for Java Developers ■ ■ ■ James Bucanek Download at WoweBook.Com xxv ■ CONTENTS Learn Objective-C for Java Developers Copyright © 2009 by James Bucanek All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher. ISBN-13 (pbk): 978-1-4302-2369-6 ISBN-13 (electronic): 978-1-4302-2370-2 Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1 Trademarked names may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, we use the names only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. Lead Editors: Clay Andres, Douglas Pundick Technical Reviewer: Evan DiBiase Editorial Board: Clay Andres, Steve Anglin, Mark Beckner, Ewan Buckingham, Tony Campbell, Gary Cornell, Jonathan Gennick, Jonathan Hassell, Michelle Lowman, Matthew Moodie, Jeffrey Pepper, Frank Pohlmann, Douglas Pundick, Ben Renow-Clarke, Dominic Shakeshaft, Matt Wade, Tom Welsh Project Manager: Kylie Johnston Copy Editor: Elizabeth Berry Compositor: Lynn L’Heureux Indexer: Ann Rogers/Ron Strauss Artist: April Milne Cover Designer: Anna Ishchenko Manufacturing Director: Michael Short Distributed to the book trade worldwide by Springer-Verlag New York, Inc., 233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax 201-348-4505, e-mail orders- [email protected], or visit http://www.springeronline.com. For information on translations, please e-mail [email protected], or visit http://www.apress.com. Apress and friends of ED books may be purchased in bulk for academic, corporate, or promotional use. eBook versions and licenses are also available for most titles. For more information, reference our Special Bulk Sales–eBook Licensing web page at http://www.apress.com/info/bulksales. The information in this book is distributed on an “as is” basis, without warranty. Although every precaution has been taken in the preparation of this work, neither the author(s) nor Apress shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in this work. The source code for this book is available to readers at http://www.apress.com. ii Download at WoweBook.Com ■ CONTENTS AT A GLANCE To the memories of my brother, John, and my father, “Dr. B.” iii Download at WoweBook.Com ■ CONTENTS Contents at a Glance About the Author ........................................................................................................ xxi About the Technical Reviewer ................................................................................. xxii Acknowledgments ................................................................................................... xxiii Introduction ................................................................................................................xiv PART 1 ■ ■ ■ Language Chapter 1: Introduction ............................................................................................. 3 Chapter 2: Java and C: Key Differences ................................................................... 11 Chapter 3: Welcome to Objective-C ........................................................................ 27 Chapter 4: Creating an Xcode Project ..................................................................... 55 Chapter 5: Exploring Protocols and Categories ...................................................... 75 Chapter 6: Sending Messages .................................................................................. 87 Chapter 7: Making Friends with nil ....................................................................... 103 PART 2 ■ ■ ■ Translating Technologies Chapter 8: Strings and Primitive Values ................................................................ 117 Chapter 9: Garbage Collection ............................................................................... 135 Chapter 10: Introspection ...................................................................................... 147 Chapter 11: Files ..................................................................................................... 163 Chapter 12: Serialization ........................................................................................ 185 Chapter 13: Communicating Near and Far .......................................................... 211 Chapter 14: Exception Handling ........................................................................... 239 iv Download at WoweBook.Com ■ CONTENTS AT A GLANCE Chapter 15: Threads ............................................................................................... 257 PART 3 ■ ■ ■ Programming Patterns Chapter 16: Collection Patterns ............................................................................. 287 Chapter 17: Delegation Pattern ............................................................................. 315 Chapter 18: Provider/Subscriber Pattern ............................................................. 325 Chapter 19: Observer Pattern ................................................................................ 339 Chapter 20: Model-View-Controller Pattern ........................................................ 353 Chapter 21: Lazy Initialization Pattern ................................................................. 403 Chapter 22: Factory Pattern ................................................................................... 411 Chapter 23: Singleton Pattern ................................................................................ 429 PART 4 ■ ■ ■ Advanced Objective-C Chapter 24: Memory Management ....................................................................... 435 Chapter 25: Mixing C and Objective-C .................................................................. 457 Chapter 26: Runtime .............................................................................................. 465 Index ......................................................................................................................... 477 v Download at WoweBook.Com Download at WoweBook.Com ■ CONTENTS AT A GLANCE Contents About the Author ........................................................................................................ xxi About the Technical Reviewer ................................................................................. xxii Acknowledgments ................................................................................................... xxiii Introduction ................................................................................................................xiv PART 1 ■ ■ ■ Language Chapter

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    521 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us