Book Image

Mac Application Development by Example: Beginner's Guide

By : Robert Wiebe
Book Image

Mac Application Development by Example: Beginner's Guide

By: Robert Wiebe

Overview of this book

It's never been more important to have the ability to develop an App for Mac OS X. Whether it's a System Preference, a business app that accesses information in the Cloud, or an application that uses multi-touch or uses a camera, you will have a solid foundation in app development to get the job done.Mac Application Development by Example takes you through all the aspects of using the Xcode development tool to produce complete working apps that cover a broad range of topics. This comprehensive book on developing applications covers everything a beginner needs to know and demonstrates the concepts using examples that take advantage of some of the most interesting hardware and software features available.You will discover the fundamental aspects of OS X development while investigating innovative platform features to create a final product which take advantage of the unique aspects of OS X.Learn how to use Xcode tools to create and share Mac OS X apps. Explore numerous OS X features including iCloud, multi-touch trackpad, and the iSight camera.This book provides you with an illustrated and annotated guide to bring your idea to life using fundamental concepts that work on Mac.
Table of Contents (17 chapters)
Mac Application Development by Example Beginner's Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Preface

Apple is taking the world by storm. Their market share is growing faster than the industry average and has been for years. So, it's never been more important to have the ability to develop an App for Mac OS X. Whether it's a System Preference, a business app that accesses information in the Cloud, or an application that uses a multi-touch trackpad or uses a camera, you will need a solid foundation in app development to get the job done.

Mac Application Development by Example takes you through all the aspects of using the Xcode development tool to produce complete working apps that cover a broad range of topics. This comprehensive book on developing applications covers everything a beginner needs to know and demonstrates the concepts using examples that take advantage of some of the most interesting hardware and software features available.

You will discover the fundamental aspects of OS X development while investigating innovative platform features to create a final product that takes advantage of some of the unique aspects of OS X.

You will learn how to use Xcode tools to create and share Mac OS X Apps and explore numerous OS X features including iCloud, multi-touch trackpad, and the iSight camera.

Using fundamental development concepts and innovative platform features, this book provides you with an illustrated and annotated guide to bring your ideas to life!

What this book covers

Chapter 1, Our First Program – SimpleCalc, covers how to get up and running with the Xcode Integrated Development Environment (IDE). We create an App icon, a user interface, implement the App behavior, and build and run the App with Xcode.

Chapter 2, Debugger – Finding and Fixing Problems, covers the concept of debugging our program code. We learn how to explore our program code when the debugger is invoked, how to change the values of our variables with the debugger, and how to use the debugger to find and fix problems in our program.

Chapter 3, System Preferences – NewDefaults, covers creating our own System Preference plugin and learning how to run command-line tools from within the System Preference to customize the behavior of the Mac OS X Finder.

Chapter 4, Business Application – Global Currency Converter, covers how to get publicly-available data from the Internet and use it to create a currency converter. We will download an XML file from the Internet and extract the information that we need from it into our program. We learn how to access the Internet using a background thread so that our user interface does not freeze while we wait for the XML file to download. Finally, we learn how to use pop-up menus, table views, and how to perform arithmetic operations on an array of numbers.

Chapter 5, Personal Information – Numbers in the iCloud, how to take your data and store it on the Internet using Cloud services Cloud services. Cloud services are popping up everywhere. We learn about Apple's iCloud and how to store and retrieve information from the iCloud servers. Along the way, we learn how to implement two table views in the same window and how to implement a toolbar.

Chapter 6, Painting – Multi-finger Paint, covers multi-touch. Mobile computing has introduced a new way of interacting with computer touches and gestures. Laptop and desktop computing have adopted this trend through the use of multi-touch trackpads. In this chapter, we learn about multi-touch, including how to handle multi-touch and gesture events. We also learn how to use the 2D drawing features of Mac OS X to draw into custom views.

Chapter 7, Capturing Still Images – iSight iMage cApture App, covers how to use the Image Kit Framework to capture and manipulate still images using the iSight camera.

Chapter 8, Video Recording – iSight Recorder, covers capturing videos. While capturing still images is nice, capturing movies is better. In this chapter, we learn how to use Quicktime Kit Capture to preview Video and Audio, to capture still frames, and to record movies using the iSight camera.

Chapter 9, Video Recording – Full Screen iSight Recorder, covers how to convert a windowed App to a full screen App. We'll learn how to convert our iSight Recorder App to a full screen App, including enhancing the user interface, giving the screen an illusion of depth, and implementing the animations used to enter and exit full screen.

Chapter 10, Sharing our App with others – Becoming a Mac developer. Now that we know how to create Mac OS X Apps, we'll want to share them. This chapter explores both the free and paid Apple developer programs - describing the features of each as well as explaining how to join them and why you might want to. It also explains code signing - what it is and how to do it. Then we'll be able to share our Mac Apps and have them interact nicely with modern security software like Gatekeeper on Mac OS X 10.8.

What you need for this book

You need a Mac OS X computer capable of running Mac OS X 10.7 or later. Some App features require Mac OS X 10.8. You also need to install Xcode Version 4 from the Mac OS X App store. Xcode is a free download.

Who this book is for

This book is for people who are programming beginners and have a great idea for a Mac OS X app and need to get started.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text are shown as follows: "In the file named BTSAppDelegate.h use the #import directive to import the <QTKit/QTKit.h> file so that the QTKit interface objects can be referenced."

A block of code is set as follows:

    // Define two local variables
    // that will contain the results
    // of various operations
    BOOL l_success = NO;
    NSError* l_error;

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

    // Define two local variables
    // that will contain the results
    // of various operations
    BOOL l_success = NO;
    NSError* l_error;

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "When we click the Next button, Xcode will ask us to select options for our new project".

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to , and mention the book title through the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website, or added to any list of existing errata, under the Errata section of that title.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.