Developing Enterprise iOS Applications James Turner Beijing • Cambridge • Farnham • Köln • Sebastopol • Tokyo Developing Enterprise iOS Applications by James Turner Copyright © 2012 James Turner All rights reserved Printed in the United States of America Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472 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 corporate@oreilly.com Editor: Brian Jepson Production Editor: Kristen Borg Proofreader: O’Reilly Production Services Cover Designer: Karen Montgomery Interior Designer: David Futato Illustrator: Robert Romano Revision History for the First Edition: 2011-12-13 First release See http://oreilly.com/catalog/errata.csp?isbn=9781449311483 for release details Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of O’Reilly Media, Inc Developing Enterprise iOS Applications, the image of a white wagtail, 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 authors assume no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein ISBN: 978-1-449-31148-3 [LSI] 1323454293 Table of Contents Preface vii Enterprise iOS Applications Apple Developers—An Army of One Build Automation Is a Bit of a Challenge Objective-C Doesn’t Play Well with Others Code Coverage Is for Weenies iTunes Connect Is a Great Way to Keep Your Legal Staff Employed You Can Have Any Style of Distribution, as Long as it’s iTunes The Road Is Long and Winding A Few Caveats 2 3 4 Concurrent Development with iOS A Little Ditty ‘bout Tom and Diane More Merge Mayhem Workspaces and Static Libraries Make Sure All Dependent Projects Do Their Own Unit Testing You Need to Plan Out Common Resource Issues You Can Still End Up Stepping on Each Other’s Feet Let’s Be Careful Out There 11 12 16 16 17 18 Automating iOS Builds 19 Introducing Hudson Breaking the News to Your IT Department Provisioning Your Build Machine Installing Hudson Creating the Build Job The Main Configuration Screen Source Code Management with Hudson Trying Your First Build Creating an Ant Build File 19 20 20 21 23 24 25 27 27 iii About the Author James Turner is a freelance journalist and developer who has recently spent more than a year developing an enterprise iOS application for a major software ISV He is a contributing editor for oreilly.com, and has written for publications as diverse as the Christian Science Monitor, Processor, Linuxworld Magazine, Developer.com and WIRED Magazine In addition to his shorter writing, he has also written two books on Java Web Development (MySQL & JSP Web Applications and Struts: Kick Start, both by Sams) He is the former Senior Editor of LinuxWorld Magazine and Senior Contributing Editor for Linux Today He has also spent more than 30 years as a software engineer and system administrator, and currently works as a Senior Software Engineer for a company in the Boston area His past employers include the MIT Artificial Intelligence Laboratory, Xerox AI Systems, Solbourne Computer, Interleaf, the Christian Science Monitor, and contracting positions at BBN and Fidelity Investments He is a committer on the Apache Jakarta Struts project and served as the Struts 1.1B3 release manager He lives in a 200-year-old Colonial farmhouse in Derry, NH with his wife and son He is an open water diver and instrument-rated private pilot, as well as an avid science fiction fan ... Developing Enterprise iOS Applications James Turner Beijing • Cambridge • Farnham • Kưln • Sebastopol • Tokyo Developing Enterprise iOS Applications by James Turner Copyright © 2012 James... Handbook logo, and the O’Reilly logo are registered trademarks of O’Reilly Media, Inc Developing Enterprise iOS Applications, the image of a white wagtail, and related trade dress are trademarks... developer who has recently spent more than a year developing an enterprise iOS application for a major software ISV He is a contributing editor for oreilly. com, and has written for publications as