26,99 €
If you’ve got incredible iOS ideas, get this book and bring them to life!
iOS 7 represents the most significant update to Apple’s mobile operating system since the first iPhone was released, and even the most seasoned app developers are looking for information on how to take advantage of the latest iOS 7 features in their app designs. That’s where iOS App Development For Dummies comes in! Whether you’re a programming hobbyist wanting to build an app for fun or a professional developer looking to expand into the iOS market, this book will walk you through the fundamentals of building a universal app that stands out in the iOS crowd.
There’s no time like now to tap into the power of iOS – start building the next big app today with help from iOS App Development For Dummies!
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Seitenzahl: 679
Veröffentlichungsjahr: 2014
iOS App Development For Dummies®
Published by: John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030-5774, www.wiley.com
Copyright © 2014 by John Wiley & Sons, Inc., Hoboken, New Jersey
Published simultaneously in Canada
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without the prior written permission of the Publisher. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online at http://www.wiley.com/go/permissions.
Trademarks: Wiley, For Dummies, the Dummies Man logo, Dummies.com, Making Everything Easier, and related trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc. and may not be used without written permission. All other trademarks are the property of their respective owners. John Wiley & Sons, Inc. is not associated with any product or vendor mentioned in this book.
LIMIT OF LIABILITY/DISCLAIMER OF WARRANTY: THE PUBLISHER AND THE AUTHOR MAKE NO REPRESENTATIONS OR WARRANTIES WITH RESPECT TO THE ACCURACY OR COMPLETENESS OF THE CONTENTS OF THIS WORK AND SPECIFICALLY DISCLAIM ALL WARRANTIES, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE. NO WARRANTY MAY BE CREATED OR EXTENDED BY SALES OR PROMOTIONAL MATERIALS. THE ADVICE AND STRATEGIES CONTAINED HEREIN MAY NOT BE SUITABLE FOR EVERY SITUATION. THIS WORK IS SOLD WITH THE UNDERSTANDING THAT THE PUBLISHER IS NOT ENGAGED IN RENDERING LEGAL, ACCOUNTING, OR OTHER PROFESSIONAL SERVICES. IF PROFESSIONAL ASSISTANCE IS REQUIRED, THE SERVICES OF A COMPETENT PROFESSIONAL PERSON SHOULD BE SOUGHT. NEITHER THE PUBLISHER NOR THE AUTHOR SHALL BE LIABLE FOR DAMAGES ARISING HEREFROM. THE FACT THAT AN ORGANIZATION OR WEBSITE IS REFERRED TO IN THIS WORK AS A CITATION AND/OR A POTENTIAL SOURCE OF FURTHER INFORMATION DOES NOT MEAN THAT THE AUTHOR OR THE PUBLISHER ENDORSES THE INFORMATION THE ORGANIZATION OR WEBSITE MAY PROVIDE OR RECOMMENDATIONS IT MAY MAKE. FURTHER, READERS SHOULD BE AWARE THAT INTERNET WEBSITES LISTED IN THIS WORK MAY HAVE CHANGED OR DISAPPEARED BETWEEN WHEN THIS WORK WAS WRITTEN AND WHEN IT IS READ.
For general information on our other products and services, please contact our Customer Care Department within the U.S. at 877-762-2974, outside the U.S. at 317-572-3993, or fax 317-572-4002. For technical support, please visit www.wiley.com/techsupport.
Wiley publishes in a variety of print and electronic formats and by print-on-demand. Some material included with standard print versions of this book may not be included in e-books or in print-on-demand. If this book refers to media such as a CD or DVD that is not included in the version you purchased, you may download this material at http://booksupport.wiley.com. For more information about Wiley products, visit www.wiley.com.
Library of Congress Control Number: 2013957974
ISBN 978-1-118-87105-8 (pbk); ISBN 978-1-118-87107-2 (ebk); ISBN 978-1-118-87110-2 (ebk)
Manufactured in the United States of America
10 9 8 7 6 5 4 3 2 1
Table of Contents
Introduction
A Bit of History
The iPhone stands alone
Enter the App Store
The iPad joins the party
The Plan for This Book
iOS and Xcode Game Changers
About This Book
Conventions Used in This Book
Icons Used in This Book
Foolish Assumptions
How This Book Is Organized
Part I: Getting Started
Part II: Building RoadTrip
Part III: Getting Your Feet Wet: Basic Functionality
Part IV: The Model and the App Structure
Part V: Adding the App Content
Part VI: The Part of Tens
Beyond the Book
Where to Go from Here
Part I: Getting Started
Chapter 1: What Makes a Great iOS App
Figuring Out What Makes a Great iOS App
Making your app work well
Handling networking, social media, and location
Designing a powerful and intuitive interface that disappears
Using the iOS Platform to the Fullest
Exploiting advantages of the system
Accessing the Internet
Knowing the location of the user
Tracking orientation and motion
Tracking users’ fingers on the screen
Playing content
Accessing information from Apple’s apps
Copying, cutting, and pasting between apps
Multitasking, background processing, and notifications
Living large on the big screen
Embracing Device Limitations
Designing for fingers
Balancing memory and battery life
Why Develop iOS Apps?
Developing with Apple’s Expectations in Mind
Thinking About You, Apps, and Money
Enter the Cloud
Developing an App the Right Way Using the Example App in This Book
What’s Next
Chapter 2: Getting to Know the SDK
Developing Using the SDK
Using Xcode to Develop an App
Creating an Xcode project
Developing the app
The Workspace Window
Workspace areas
Displaying an area’s content
The toolbar and Tab bar
The Organizer window
Chapter 3: The Nuts and Bolts of an Xcode Project
Creating Your Project
Exploring Your Project
The project
The Project editor
The Project navigator
Setting Your Xcode Preferences
Building and Running Your Application
Building an app
The iPad’s Split views
The Log navigator
Running in the Simulator
Interacting with your simulated hardware
Making gestures
Uninstalling apps and resetting your device
Living with the Simulator’s limitations
Using Asset Catalogs
Adding the Image and Sound Resources and an App Icon
Part II: Building RoadTrip
Chapter 4: Storyboards and the User Experience
Introducing the Storyboard
Telling your story
Working with object graphs
Defining What You Want an App to Do: The RoadTrip App
Creating the Application Architecture
What You Add Where
Using Frameworks
Using Design Patterns
The iOS design patterns
The Model-View-Controller (MVC) design pattern
Working with Windows and Views
Looking out the window
Admiring the view
The kinds of views you use
View Controllers — the Main Storyboard Players
What About the Model?
It’s Not That Neat
Taking a Look at Other Frameworks
The Foundation framework
The CoreGraphics framework
Even more frameworks
Understanding the MVC in the Project
Chapter 5: Creating the RoadTrip User Interface
Creating Your User Interface in the iPad Storyboard
It’s about the view controller
Using Interface Builder to add the user elements
Working within the Utility Area
Inspector and Quick Help pane
Library pane
Understanding iPad Navigation
Adding a New View Controller
Danger Will Robinson
Adding an identifier to the view controller
View Layout
Adding the User Interface Objects
Autosizing with Auto Layout
Adding the Test Drive button
Massaging the Template Code
Getting Rid of Warnings
Creating the iPhone User Interface
Chapter 6: The Runtime, Managing Memory, and Using Properties
Stepping Through the App Life Cycle
UIApplicationMain
Handling events while your application is executing
Knowing what to do when the normal processing of your application is interrupted
An overview of the view controller life cycle
Working within the Managed Memory Model Design Pattern
Understanding memory management
Using reference counting
Automatic Reference Counting (ARC)
Working with variable types according to ARC
Understanding the deadly retain cycle
Observing Low-Memory Warnings
The didReceiveMemoryWarning method
The applicationDidReceive MemoryWarning: method
The UIApplicationDidReceiveMemory WarningNotification: notification
Picking the right memory-management strategy for your application
Customizing the Behavior of Framework Classes
Subclassing
The Delegation pattern
Understanding Declared Properties
What comprises a declared property
Using dot syntax
Setting attributes for a declared property
Writing your own accessors
Accessing instance variables with accessors
Hiding Instance Variables
Chapter 7: Working with the Source Editor
Navigating in the Xcode Source Editors
Using the Jump bar
Organizing your code using the #pragma mark statement
Using the Xcode Source Editor
Using Live Issues and Fix-it
Compiler warnings
The Issue navigator
Accessing Documentation
Getting Xcode help
The Organizer window
The Help menu
Finding and Searching in Your Project
Using the Find command to locate an item in a file
Using the Search navigator to search your project or framework
Using the Symbol navigator
You’re Finally Ready to Write Code!
Part III: Getting Your Feet Wet: Basic Functionality
Chapter 8: It’s (Finally) Time to Code
Checking for Network Availability
Downloading the Reachability sample
Adding the code to check for reachability
Exploring the Changes in iOS 7
The dated interface
Losing the content
Setting the Master View Controller Title
Understanding Autorotation
Writing Bug-Free Code
Working in the Debug area and Debug navigator
Managing breakpoints
What you’ll find in the Debug area
What you’ll find in the Debug navigator
Displaying variables in the Source editor
Tiptoeing through your program
Chapter 9: Adding Outlets and Actions to Your RoadTrip Code
Using Custom View Controllers
Adding the custom view controller
Setting up the TestDriveController in the MainStoryboard for iPad
Understanding Outlets
Adding Outlets
Opening the Assistant editor
Creating the outlet
The Connections inspector
Working with the Target-Action Design Pattern
Using the Target-Action pattern: It’s about controls
Adding an action
How Outlets and Actions Work
Update the iPhone storyboard file
Chapter 10: Adding Animation and Sound to Your App
Understanding iOS Animation
View geometry and coordinate systems
Points versus pixels
A view’s size and position
Working with data structures
Coordinating Auto Layout, Frames, and Constraints
Animating a View
Finally, More Code
Implementing the testDrive Method
Understanding Block Objects
Rotating the Object
Working with Audio
Tracking Touches
Animating a Series of Images “In Place”
iPhone versus iPad
Part IV: The Model and the App Structure
Chapter 11: The Trip Model
What the Model Contains
Adding the Model Data
Using property lists
Adding a property list to your project
Adding the First Two Model Classes
Understanding the Trip Interface
Implementing the Trip Class
Initializing objects
Invoking the superclass’s init method
Initializing instance variables
Returning self
Initializing the Destination Class
Creating the Trip Object
More Debugger Stuff
Chapter 12: Implementing the Master View Controller
Setting Up a Custom View Controller for the iPad
Adding a Background Image and Title
Updating the iPhone Storyboard File
Chapter 13: Working with Split View Controllers and the Master View
The Problem with Using a Navigation Controller in Detail View
Using a Navigation Controller in the Master View
Adding a Gesture Recognizer
The Split View Controller
The UISplitViewController delegate
Localization
Back to the main feature
Adding the Toolbar
Adding the button when the view controller is replaced
A Few More Tweaks to the MasterViewController
And (a Little Extra) One More Thing
Don’t Forget the iPhone
Chapter 14: Finishing the Basic App Structure
Extending the iPad Storyboard to Add More Functionality to Your App
Adding the Weather view controller
Adding the Events controller
Adding the remaining controllers
Changing the Split View Controller to a Detail View Controller Relationship
Repeat for iPhone
Part V: Adding the App Content
Chapter 15: How’s the Weather? Working with Web Views
The Plan
The iPad storyboard
The iPhone storyboard
Setting Up the Weather Controller
Adding the custom view controller
Setting Up WeatherController in the Main_iPad.storyboard file
The Weather Controller
Managing links in a Web view
More Opportunities to Use the Debugger
Unrecognized selector sent to instance
Repeat for the iPhone Storyboard
Adding the WeatherController to the iPhone storyboard file
Test in the iPhone Simulator
Chapter 16: Displaying Events Using a Page View Controller
The Plan
Setting Up the EventsController
Adding the custom view controller
Setting up the EventsController in the MainStoryboard
Adding and setting up the EventPageController in the MainStoryboard
Extending the Trip Model
Adding the Events Class
The EventsController and Its PageViewController
Data sources and delegates
Data source
Delegate
The EventsController
The EventPageController
Adding Events Support to the iPhone Storyboard
Chapter 17: Finding Your Way
The Plan
Setting Up the Map Controller
Adding the custom view controller
Setting up the MapController in the Main_iPad.Storyboard
Test
Putting MapKit through Its Paces
MKMapView
Enhancing the map
Changing the Map Type
Adding Annotations
Creating the annotation
Displaying the map title and annotations
Going to the Current Location
Fixing the Status Bar
Update the iPhone Storyboard
Chapter 18: Geocoding
Understanding Geocoding on the iPad
Reverse Geocoding
Chapter 19: Finding a Location
Setting Up the Find Controller
Adding the custom view controller
Setting up FindControllerin the Main_iPad File
Implementing the Find Controller
Adding the Map View
Getting the text
Disabling cell highlighting
Finding the Location
Making the Map Title the Found Location
Adding the FindController to the iPhone Storyboard
Chapter 20: Selecting a Destination
The Plan
Setting Up the DestinationController for the iPad Storyboard
Adding the custom view controller
Setting up the DestinationController in the Main_iPad.storyboard
Adding a Modal View
Implementing a Table View
Creating the Table View
Adding sections
Displaying the cell
Working with user selections
Saving the Destination Choice and Selecting a Destination
Displaying the Destination table
Testing
Adding Destination Support to the iPhone Storyboard
A Word about Adding Settings
What’s Next?
Part VI: The Part of Tens
Chapter 21: Ten Ways to Be Successful with Apps
Make a Million Dollars in a Week
Build a Portfolio
Build App Icons
Design User Interfaces
Build Back Ends
Socialize with Apps
Talk About Apps with People Who Want Them
Promote Apps
Provide Support to Users
Fix Bugs
Chapter 22: Ten Ways to Be a Happy Developer
Keep Things Loosely Coupled
Remember Memory
Don’t Reinvent the Wheel
Understand State Transitions
Do the Right Thing at the Right Time
Avoid Mistakes in Error Handling
Use Storyboards
Remember the User
Keep in Mind That the Software Isn’t Finished Until the Last User Is Dead
Keep It Fun
About the Author
Cheat Sheet
More Dummies Products
Table of Contents
Begin Reading
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
384
383
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
408
407
409
410
411
412
413
414
415
416
417
418
419
420
421
422
424
423
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
559
560
iOS App Development For Dummies is a beginner’s guide to developing iOS apps. And not only do you not need any iOS development experience to get started, but you also don’t need any Mac development experience, either. I’ve written this book as though you are coming to iPhone and iPad app development as a blank slate, ready to be filled with useful information and new ways to do things. Well, almost a blank slate, anyway; see the upcoming “Foolish Assumptions” section for details on what you do need to know before using this book.
Because of the nature of the iPhone and iPad, you can create small, bite-sized apps that can be quite powerful. Also, because you can start small and create real applications that do something important for a user, it’s relatively easy to transform yourself from an “I know nothing” person into a developer who, though not (yet) a superstar, can still crank out quite a respectable app.
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!