Skip to Main Content
Professional iPhone® and iPad™ Application Development
book

Professional iPhone® and iPad™ Application Development

by Gene Backlin
November 2010
Intermediate to advanced content levelIntermediate to advanced
600 pages
14h 21m
English
Wrox
Content preview from Professional iPhone® and iPad™ Application Development

Appendix C. Cocoa Touch Static Libraries

WHAT'S IN THIS APPENDIX?

  • How to create a static library

  • Designing the static library to be an efficient component

  • How to include a static library in an Xcode application project

I am a big fan of reusability. I only like to write code once. Using Xcode, you can build a static library of useful routines so you don't have to write the same code repeatedly, or, worse yet, cut and paste the same code all over the place.

While it may seem harmless and easy to just cut and paste code wherever you need it, imagine you have several applications in the iTunes App Store already and you have just discovered a major bug in your code that causes the apps to crash. After spending hours tracking down the bug, you now have to fix it in all of the other applications — a tedious, time-consuming task.

Needless to say, this is not fun; and there is a solution, which is what this appendix is all about. In Chapter 10, "Data Storage," you worked through a contacts application using both property lists and Core Data. This appendix uses the property list application from Chapter 10, separating the data storage component and making it into a static library. That way, the contacts application focuses on user interaction, and the static library can be used for storing the contact information.

XCODE PROJECT TEMPLATE

Creating a static library is similar to creating an application; you merely choose a different template. The important thing to keep in mind about a static library ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Professional Visual Studio® 2010

Professional Visual Studio® 2010

Nick Randolph, David Gardner, Michael Minutillo, Chris Anderson
Navigating the Metaverse

Navigating the Metaverse

Cathy Hackl, Dirk Lueth, Tommaso Di Bartolo, John Arkontaky, Yat Siu
Navigating the Metaverse

Navigating the Metaverse

Cathy Hackl, Dirk Lueth, Tommaso Di Bartolo

Publisher Resources

ISBN: 9780470878194Purchase book