Is it possible for JavaScript programmers to learn Apple's iOS 4 SDK and live to tell the tale? Technology guru Danny Goodman did, and with this book he leaves a well-marked trail for you to follow. An authority on JavaScript since its inception, Goodman understands the challenges you might face in creating native iOS apps with this SDK, and introduces Xcode, Objective-C, and Cocoa Touch in a context you'll readily understand.
Why bother with the SDK when you can simply build web apps for Apple's iOS devices? Web apps can't access an iPhone's music library, camera, or iOS system software for maps, audio, and more. Nor can you sell web apps in the App Store. If you want to take full advantage of the iPhone and iPad, iOS 4 SDK is your tool -- and this is your book. Includes full coverage of iOS SDK 4.2.
Learn the distinction between web app and iOS native app programming
Create a workbench app to test code snippets throughout the learning process
Get a structural view of an iOS app, and compare the process of building objects in Objective-C versus JavaScipt
Discover how your code launches iOS apps and makes them user-ready
Learn about iOS memory management details that are different from JavaScript, including pointers and data types
Use Objective-C and Cocoa Touch to implement common JavaScript tasks
Chapter 1 Why Go Native?
Using an App Offline
More Access to the Hardware
More Access to the Software
What You Lose
Taking the Plunge
Chapter 2 Welcome to the iOS SDK
Hardware and OS Requirements
Installing the SDK
About iOS Developer Programs
Inside the SDK
Viewing Developer Documentation
Loading Code Samples
Setting the Project’s Base SDK
Trying the iOS Simulator
Coming Up...
Chapter 3 Creating a Test Workbench
Creating the Project in Xcode
Building the User Interface
Chapter 4 Structural Overview of an iOS App
Where It All Begins: APIs
Frameworks
Welcome to Class Files
Using Xcode to Create DGCar Class Files
Integrating the DGCar Class into Workbench
Recap
Chapter 5 App Execution Flow
Some C Language Roots in an iOS App
An Introduction to Delegates
iPhone App Development Design Patterns
The Importance of Views
Recap
Chapter 6 Central Objective-C Concepts: Pointers, Data Types, and Memory Management
Pointers
Data Typing
Memory Management
Recap
Chapter 7 C Language Fundamentals
Variable Names
Variable Scope
Constant Values
Functions
C Structures
C Arrays
Enumerated Types
Operators
Program Flow Constructions
Boolean Values
Math Object Equivalents in C
Inserting Comments
Recap
Chapter 8 Objective-C/Cocoa Touch Fundamentals
More About Classes
Real Classes in Real Action
Class Properties
About NSString
About NSArray
About NSDictionary
Arrays and Dictionaries in Action
Recap
Chapter 9 Common JavaScript Tasks in Cocoa Touch
Formatting Numbers for Display
Creating a Date Object
Calculating Dates
Downloading Remote Files Asynchronously
Reading and Writing Local Files
Sorting Arrays
Capturing User-Entered Text
Validating Text Entry with Regular Expressions
Using Regular Expressions for Text Search and Replace
Dragging a View Around the Screen
Recap
Appendix Getting the Most from Xcode Documentation
Danny Goodman has been writing about personal computers and consumer electronics since the late 1970s. He has written hundreds of magazine articles, several commercial software products, and three dozen computer books. Most recently, Danny has been programming applications for Apple's iPhone and iPod touch platform, including iFeltThat Earthquake, PhotoSize, and BeaconAid-HF, all available on Apple's App Store.
Comments about O'Reilly Media Learning the iOS 4 SDK for JavaScript Programmers:
Learning the iOS 4 SDK for JavaScript Programmers: Create Native Apps with Objective-C and Xcode is a good getting started book for the right audience. I sit on the border of being in that audience, but did still manage to learn lots, and enjoy doing so.
In the JavaScript world there is a continuum from copy and paste HTML types passing by library ciders (experts in something like Jquery but not much else) on through to the people who live and breath Crockfords JavaScript: The Good Parts. The guys on the left know a couple of bits of JavaScript but struggle to get beyond a for loop. The guys on the right will argue about prototypal and classical inheritance and the merits and weaknesses of dynamically typed languages. Learning the iOS 4 SDK for JavaScript Programmers is clearly aimed at the 80% in the middle of the list(with a tendency towards the non-hardcore). The hardcore JavaScript programmers will almost certainly get frustrated with some of the imprecise statements and comparisons. While the analogies help non-experts understand Objective C, they don't always get the true prototypal functional nature of JavaScript described right.
I picked this up as a way of getting into iPad development. Using it as a followup from the last book I read — App Savvy. When getting the book I knew I wasn't in the exact target audience having spent many years doing java before recently moving to more full time JavaScript. I'm also on the right hand (almost) expert/heavy nerd JavaScript guy and have a bit of an understanding of how it works as a language, and so found the book a little off the mark. That said, I definitely learnt heaps and found it a helpful read. The fact that I didn't have to go through the full details of C syntax and the author leveraged my JavaScript knowledge to explain was a definite plus. Overall I'd definitely recommend the book to the 80% in the middle and cautiously recommend it to the right hard core JavaScript programmers.
[reviewed as a part of the O'Reilly Blogger Review program]