E-Book, Englisch, 292 Seiten
Bennett / Lees / Fisher Objective-C for Absolute Beginners
1. ed
ISBN: 978-1-4302-2833-2
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark
iPhone, iPad and Mac Programming Made Easy
E-Book, Englisch, 292 Seiten
ISBN: 978-1-4302-2833-2
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark
It seems as if everyone is writing applications for Apple's iPhone and iPad, but how do they all do it? It's best to learn Objective-C, the native language of both the iOS and Mac OS X, but where to begin? Right here, even if you've never programmed before! Objective-C for Absolute Beginners will teach you how to write software for your Mac, iPhone, or iPad using Objective-C, an elegant and powerful language with a rich set of developer tools. Using a hands-on approach, you'll learn to think in programming terms, how to use Objective-C to build program logic, and how to write your own applications and apps. With over 50 collective years in software development and based on an approach pioneered at Carnegie Mellon University, the authors have developed a remarkably effective approach to learning Objective-C. Since the introduction of Apple's iPhone, the authors have taught hundreds of absolute beginners how to develop Mac, iPhone,and iPad apps, including many that became popular apps in the iTunes App Store.
Gary Bennett is president of xcelMe.com. xcelMe teaches iPhone/iPad programming courses online. Gary has taught hundreds of students how to develop iPhone/iPad apps, and has several very popular apps on the iTunes App Store. Gary's students have some of the best-selling apps on the iTunes App Store. Gary also worked for 25 years in the technology and defense industries. He served 10 years in the U.S. Navy as a nuclear engineer aboard two nuclear submarines. After leaving the Navy, Gary worked for several companies as a software developer, chief information officer, and resident. As CIO, he helped take VistaCare public in 2002. Gary also co-authored iPhone Cool Projects for Apress. Gary lives in Scottsdale, Arizona with his wife, Stefanie, and their four children.
Autoren/Hrsg.
Weitere Infos & Material
1;Title Page;1
2;Copyright Page;2
3;Contents at a Glance;4
4;Tabe of Contents;5
5;About the Authors;10
6;About the Technical Reviewer;11
7;Acknowledgments;12
8;Introduction;13
8.1;For the Newbie;13
8.2;For the More Experienced;13
8.3;Why Alice: An Innovative 3D Programming Environment;13
8.4;How This Book Is Organized;14
8.5;The Formula for Success;14
8.6;The Development Technology Stack;15
8.7;Required Software, Materials, and Equipment;15
8.7.1;Operating System and IDE;16
8.7.2;Software Development Kits;16
8.7.3;Dual Monitors;16
8.7.4;Book Forum;17
9;Chapter 1 Becoming a Great iPhone/iPad or Mac Programmer;18
9.1;Thinking Like a Developer;18
9.2;Completing the Development Cycle;21
9.3;Introducing Object Oriented Programming;23
9.4;Working with the Alice Interface;25
9.5;Summary;28
9.6;Exercises;28
10;Chapter 2 Programming Basics;29
10.1;Taking a Tour with Alice;29
10.1.1;Navigation Menu;30
10.1.2;World Window;31
10.1.3;Classes, Objects, and Instances in Alice;33
10.1.4;Object Tree;34
10.1.5;Editor Area;34
10.1.6;Details Area;35
10.1.7;Events Area;35
10.2;Creating an Alice App—To the Moon Alice;36
10.3;Your First Objective-C Program;42
10.3.1;Installing Xcode;43
10.3.2;Launching and Using Xcode;46
10.4;Summary;51
10.5;Exercises;52
11;Chapter 3 It’s All About the Data;53
11.1;Numbering Systems Used in Programming;53
11.1.1;Bits;53
11.1.1.1;Moore’s Law;54
11.1.2;Bytes;55
11.1.3;Hexadecimal;57
11.1.4;Unicode;58
11.2;Data Types;58
11.3;Using Variable and Data Types with Alice;59
11.4;Data Types and Objective-C;66
11.5;Identifying Problems;70
11.6;Summary;72
11.7;Exercises;72
12;Chapter 4 Making Decisions About…and Planning Program Flow;73
12.1;Boolean Logic;73
12.1.1;Truth Tables;75
12.1.2;Comparison Operators;77
12.2;Designing Apps;78
12.2.1;Pseudo-code;78
12.3;Design Requirements;80
12.3.1;Flowcharting;83
12.3.2;Designing and Flowcharting an Example App;84
12.3.3;The App’s Design;85
12.3.4;Using Loops to Repeat Program Statements;86
12.3.4.1;Count-Controlled Loops;86
12.3.4.2;Condition-Controlled Loops;87
12.3.4.3;Infinite Loops;87
12.4;Coding the Example App in Alice;88
12.5;Coding the Example App in Objective-C;90
12.6;Nested If Statements and Else-If Statements;93
12.7;Improving the Code Through Refactoring;93
12.8;Moving Forward Without Alice;94
12.9;Summary;95
12.10;Exercises;96
13;Chapter 5 Object Oriented Programming with Objective-C;97
13.1;The Object;97
13.2;What Is a Class;98
13.3;Planning Classes;99
13.4;Inheritance;109
13.5;Why Use OOP?;110
13.5.1;Eliminate Redundant Code;110
13.5.2;Ease of Debugging;111
13.5.3;Ease of Replacement;111
13.6;Advanced Topics;111
13.6.1;Interface;111
13.6.2;Polymorphism;111
13.7;Summary;112
13.8;Exercises;112
14;Chapter 6 Introducing Objective-C and Xcode;113
14.1;A Brief History of Objective-C;113
14.2;Understanding C Language Basics;114
14.3;Putting the “Objective” into Objective-C;116
14.4;Introducing Xcode;121
14.5;Starting Up Xcode;122
14.6;Creating Your First Project;123
14.6.1;Adding a New Class;124
14.6.2;Building and Running the New Program;130
14.7;Summary;131
14.8;Exercises;132
15;Chapter 7 Objective-C Classes, Objects, and Methods;133
15.1;Creating an Objective-C Class;133
15.1.1;Declaring Interfaces and Instance Variables;135
15.1.2;Sending Messages (Methods);135
15.1.2.1;Using Class Methods;136
15.1.2.2;Using Instance Methods;137
15.1.3;Working with the Implementation File;137
15.1.4;Implementing Methods;139
15.2;Using Our New Class;141
15.2.1;Overriding Default Behavior;148
15.2.2;Taking Class Methods to the Next Level;149
15.3;Accessing the Xcode Documentation;149
15.4;Summary;150
15.5;Exercises;151
16;Chapter 8 Programming Basics in Objective-C;152
16.1;Creating a Simple Command Line Tool;153
16.2;Introducing Instance Variables;155
16.2.1;Accessing Instance Variables;156
16.2.2;Using Getter and Setter Methods;157
16.3;Introducing Properties;159
16.3.1;Using Properties;160
16.3.2;Understanding the Importance of Conventions;161
16.4;Creating the MyBookstore Program;161
16.4.1;Using the NSMutableDictionary Class;163
16.4.2;Making Our Object Do Something;164
16.4.3;Implementing Behavior;165
16.4.4;Cleaning Up Our Objects;168
16.4.5;Using the Bookstore and Book Objects;169
16.5;Summary;171
16.6;Exercises;171
17;Chapter 9 Comparing Data;172
17.1;Introducing Boolean Logic;172
17.2;Using Relational Operators;173
17.2.1;Comparing Numbers;173
17.2.2;Creating an Example Xcode App;175
17.3;Using Boolean Expressions;178
17.3.1;Comparing Strings;179
17.3.2;Comparing Dates;181
17.3.3;Combining Comparisons;183
17.4;Using the Switch Statement;183
17.5;Grouping Variables Together;185
17.5.1;NSArray;185
17.5.2;NSMutableArray;186
17.5.3;NSDictionary;187
17.5.4;NSMutableDictionary;187
17.6;Summary;188
17.7;Exercises;189
18;Chapter 10 Creating User Interfaces with Interface Builder;190
18.1;Understanding Interface Builder;191
18.2;The Model-View-Controller;192
18.3;Human Interface Guidelines (HIGs);194
18.4;Creating an Example iPhone App with Interface Builder;195
18.4.1;Using Outlets;200
18.4.2;Implementing an Action;201
18.4.3;Using Interface Builder;202
18.4.4;Document Window;203
18.4.5;Library Window;204
18.4.6;Inspector Window;205
18.4.7;Creating the View;206
18.4.8;Connecting the Outlets and Objects;207
18.4.9;Connecting Actions and Objects;208
18.4.10;Implementation File;210
18.5;Broken Connections in Interface Builder;211
18.6;Summary;213
18.7;Exercises;213
19;Chapter 11Memory, Addresses, and Pointers;214
19.1;Understanding Memory;215
19.1.1;Bits, Bytes, and Bases;215
19.1.2;Converting Base-10 (Decimal) to Base-2 (Binary);216
19.1.3;Using Base-16 (Hexadecimal) Numbering;217
19.2;Understanding Memory Address Basics;219
19.2.1;Using the Dereference Operator;222
19.3;Requesting Memory;223
19.3.1;Working with Automatic Variables and Pointers;223
19.4;Deallocating Memory;224
19.4.1;Using Special Pointers;225
19.5;Managing Memory in Objective-C;227
19.5.1;Using the Retain/Release Model;227
19.5.2;Working with Implied Retain Messages;229
19.5.3;Sending the dealloc Message;230
19.6;If Things Go Wrong;231
19.7;Summary;232
19.8;Exercises;233
20;Chapter 12 Debugging Programs with Xcode;234
20.1;Getting Started with Debugging;235
20.1.1;Setting Breakpoints;235
20.1.2;Debugging Basics;237
20.1.3;Working with the Debugger Controls;238
20.2;Debugging a Program;239
20.2.1;Using the Step Controls;240
20.2.2;Looking at the Thread Window and Call Stack;240
20.2.3;Debugging Variables;241
20.2.4;Deleting Multiple Breakpoints;245
20.2.5;Disabling Breakpoints;246
20.2.6;A Larger Call Stack;246
20.3;Summary;249
20.4;Exercises;250
21;Chapter 13 Storing Information;251
21.1;Storage Considerations;251
21.2;Preferences;251
21.2.1;Writing Preferences;252
21.2.2;Reading Preferences;253
21.3;Databases;253
21.4;Storing Information in a Database;254
21.5;Getting Started with Core Data;255
21.6;The Model;256
21.6.1;Managed Object Context;264
21.7;Setting Up the Interface;264
21.8;Summary;269
21.9;Exercises;269
22;Chapter 14 Protocols and Delegates;270
22.1;Multiple Inheritance;270
22.2;Understanding Protocols;271
22.2.1;Protocol Syntax;272
22.3;Understanding Delegates;272
22.4;Next Steps;273
22.5;Summary;274
23;Index;275




