Home Page Icon
Home Page
Table of Contents for
About the Technical Reviewer
Close
About the Technical Reviewer
by Wallace Wang
Mac Programming for Absolute Beginners
Copyright
About the Author
About the Technical Reviewer
Acknowledgments
Introduction
Code Conventions Used in This Book
What to Expect from This Book
1. Understanding Programming
1.1. Programming Principles
1.1.1. Dividing Programs into Parts
1.1.2. Event-Driven Programming
1.1.3. Object-Oriented Programming
1.1.3.1. Encapsulation
1.1.3.2. Polymorphism
1.1.3.3. Inheritance
1.2. Understanding Programming Languages
1.2.1. The Building Blocks of Programming Languages
1.2.2. ProgrammingFrameworks
1.2.3. Mac Programming Today
1.3. Summary
2. Understanding Apple's Programming Tools
2.1. Understanding Editors
2.2. Understanding Xcode
2.2.1. Deciphering the Xcode User Interface
2.2.2. Running Xcode
2.2.3. Creating a New Project in Xcode
2.2.4. Examining Project Files in Xcode
2.2.5. Compiling a Program
2.3. Summary
3. The Basic Steps to Creating a Mac Program
3.1. A Bare-Bones Program Example
3.2. A Simple User Interface Example
3.3. An Interactive User Interface Example
3.3.1. Writing Objective-C Code
3.3.1.1. Creating an Action Method
3.3.2. Connecting the User Interface
3.4. An Advanced Interactive User Interface Example
3.5. Summary
4. Getting Help
4.1. Installing Help Topics
4.2. Getting Help About Xcode
4.3. Getting Help About Core Library
4.4. Searching for Help
4.5. Getting Quick Help
4.6. Viewing Documentation for Selected Text
4.7. Getting Help with Library Windows
4.8. Help While Writing Code
4.8.1. Color-Coding
4.8.2. Customizing the Editor
4.8.3. Using Code Completion
4.9. Summary
5. Learning Objective-C
5.1. Differences in Writing a Mac Objective-C Program
5.2. Understanding Objective-C Symbols
5.2.1. Defining the End of Each Line with a Semicolon
5.2.2. Defining the Beginning and End of Code with Curly Brackets
5.2.3. Defining Compiler Directives with the # Symbol
5.2.4. Defining Comments with //
5.2.5. Identifying Objects with [ and ]
5.2.6. Defining Pointers with *
5.3. Manipulating Data with Variables
5.3.1. Declaring Variables
5.3.2. Assigning Data to a Variable
5.3.3. The Scope of a Variable
5.3.4. A Program Example Using Variables
5.4. Using Constants
5.5. Using Mathematical Operators
5.6. Using Strings
5.7. Summary
6. Making Decisions with Branches
6.1. Understanding Boolean Expressions
6.1.1. Boolean Comparison Operators
6.1.2. Boolean Logical Operators
6.1.2.1. The ! (Not) Operator
6.1.2.2. The && (And) Operator
6.1.2.3. The || (Or) Operator
6.1.2.4. The ^ (Xor) Operator
6.2. Branches
6.2.1. The Simplest if Statement
6.2.2. Following Multiple Instructions in an if Statement
6.2.3. The if-else Statement
6.2.4. The if-else if Statement
6.2.5. The switch Statement
6.3. Summary
7. Repeating Code with Loops
7.1. Loops That Run a Fixed Number of Times
7.1.1. Quitting a for Loop Prematurely
7.1.2. Skipping in a for Loop
7.2. Loops That Run Zero or More Times
7.2.1. The while Loop
7.2.2. The do-while Loop
7.2.3. Quitting a while or do-while Loop Prematurely
7.2.4. Skipping a while or do-while Loop
7.3. Nested Loops
7.4. Summary
8. Understanding the Cocoa Framework
8.1. An Overview of How Object-Oriented Programming Works
8.1.1. Starting with a Class
8.1.2. Reducing Bugs
8.1.3. Reusing Code
8.1.4. Defining Classes
8.2. Creating an Object
8.3. Storing Data in an Object
8.4. A Sample Program for Manipulating Objects
8.5. Looking Up Method and Property Names for NS Classes
8.6. Summary
9. Manipulating Strings
9.1. Declaring a String Variable
9.2. Getting the Length of a String
9.3. Comparing Two Strings
9.4. Checking for Prefixes and Suffixes
9.5. Converting to Uppercase and Lowercase
9.6. Converting Strings to Numbers
9.7. Searching for a Substring
9.7.1. The location Field
9.7.2. The length Field
9.8. Searching and Replacing
9.8.1. Replacing Part of a String at a Specific Location
9.8.2. Searching for and Replacing Part of a String
9.9. Deleting Part of a String
9.10. Extracting a Substring
9.10.1. Extracting a Substring with a Location and Length
9.10.2. Extracting a Substring to the End of a String
9.11. Appending a Substring
9.12. Inserting a String
9.13. Summary
10. Arrays
10.1. Creating an Array
10.1.1. Finding the Right Method to Use
10.1.2. StoringObjects in an Array
10.1.3. Additional Methods for Filling an Array
10.2. Counting the Items Stored in an Array
10.3. Accessing an Item in an Array
10.4. Accessing All Items in an Array
10.5. Adding Items to an Array
10.6. Inserting Items into an Array
10.7. Deleting Items from an Array
10.7.1. Deleting the Last Item in an Array
10.7.2. Deleting an Item from a Specific Index Position
10.7.3. Deleting Every Item from an Array
10.7.4. Deleting All Instances of an Item from an Array
10.8. Summary
11. Dictionaries and Sets
11.1. Dictionary Basics
11.2. Creating and Putting Data in a Dictionary
11.3. Counting the Items Stored in a Dictionary
11.4. Retrieving an Item from a Dictionary
11.5. Deleting Data from a Dictionary
11.6. Copying a Dictionary
11.7. Copying Dictionary Data Into an Array
11.8. Sorting Keys
11.9. Access All Items in a Dictionary
11.10. Using Sets
11.11. Creating and Putting Data in a Set
11.12. Counting the Number of Items in a Set
11.13. Checking Whether Data Is in a Set
11.14. Adding and Removing Data in a Set
11.15. Accessing All Items in a Set
11.16. Getting the Intersection of Two Sets
11.17. Identifying a Subset of a Set
11.18. Summary
12. Creating Classes and Objects
12.1. Creating a Class
12.2. Understanding the Code in a Class
12.3. Deleting Class Files
12.4. A Program Example of a Class
12.5. Creating Methods
12.5.1. Passing Parameters
12.5.1.1. Passing Multiple Parameters
12.5.1.2. Passing Objects as Parameters
12.5.2. Returning Values from a Method
12.5.3. Passing by Reference
12.6. Creating Class Properties
12.6.1. Defining Properties
12.6.2. Accessing and Getting Values in Properties
12.7. Summary
13. Inheritance, Method Overriding, and Events
13.1. Object Inheritance
13.2. Method Overriding
13.3. Responding to Events
13.3.1. Understanding the Application Delegate
13.4. Summary
14. Creating a User Interface
14.1. Getting to Know Interface Builder
14.1.1. Creating a New User Interface .xib File
14.2. Understanding the Parts of a .XIB File
14.2.1. Placeholder Objects
14.2.2. Interface Objects
14.2.3. Toggling the View of Placeholder and Interface Objects
14.3. Designing a User Interface
14.4. Customizing User Interface Objects
14.4.1. Moving and Resizing User Interface Objects
14.4.2. Autosizing and Anchoring User Interface Objects
14.5. Summary
15. Choosing Commands with Buttons
15.1. Creating a Button
15.2. Creating a Button Title
15.3. Adding a Graphic Image
15.4. Customizing the Visual Behavior of a Button
15.5. Making Buttons Easier to Use
15.5.1. Creating Tooltips
15.5.2. Adding Sound
15.5.3. Choosing a Button with a Keystroke Combination
15.6. Connecting a Button to an IBAction
15.6.1. Alternate Dragging Option
15.7. Breaking a Link to an IBAction Method
15.8. Summary
16. Making Choices with Radio Buttons and Check Boxes
16.1. Radio Buttons
16.1.1. Creating and Adding Radio Buttons
16.1.2. Creating a Radio Button Title
16.1.3. Defining a Radio Button's State
16.2. Determining Which Radio Button a User Selected
16.3. Check Boxes
16.3.1. Creating Check Boxes
16.3.2. Defining a Check Box's Title and State
16.4. Summary
17. Making Choices with Pop-Up Buttons
17.1. Pop-Up Button Basics
17.2. Creating a Pop-Up Button List in Interface Builder
17.2.1. Adding (and Deleting) Items on a Pop-Up Button List
17.2.2. Renaming an Item in a Pop-Up Button List
17.3. Modifying a Pop-Up Button's List with Code
17.4. Determining What a User Selected
17.5. Summary
18. Inputting and Outputting Data with Labels, Text Fields, and Combo Boxes
18.1. Using Labels
18.1.1. Adding a Label to Your User Interface
18.1.2. Editing Text on a Label
18.2. Using Text Fields
18.2.1. Adding a Text Field to Your User Interface
18.2.2. Editing Text in a Text Field
18.2.3. Retrieving Data from a Text Field
18.3. Using Combo Boxes
18.3.1. Adding a Combo Box to Your User Interface
18.3.2. Creating a List for a Combo Box
18.3.3. Retrieving a Value from a Combo Box
18.4. Wrapping Labels and Text Fields
18.5. Summary
19. Inputting Data with Sliders, Date Pickers, and Steppers
19.1. Using Sliders
19.1.1. Defining Values
19.1.2. Displaying Tick Marks
19.1.3. Retrieving and Displaying a Slider's Value
19.2. Using a Date Picker
19.2.1. Retrieving a Date from a Date Picker
19.3. Using Steppers
19.4. Summary
20. Using Built-In Dialog Boxes
20.1. Using Alert Dialog Boxes
20.1.1. Displaying Text on a Dialog Box
20.1.2. Displaying a Suppression Check Box
20.1.3. Displaying Buttons on a Dialog Box
20.2. Creating an Open Panel
20.2.1. Limiting File Types
20.2.2. Allowing Multiple File Selections
20.3. Creating a Save Panel
20.3.1. Limiting File Types
20.4. Summary
21. Creating Pull-Down Menus
21.1. Editing Pull-Down Menus
21.1.1. Editing a Menu or Menu Item
21.1.2. Moving a Menu or Menu Item
21.1.3. Deleting Menus and Menu Items
21.1.4. Creating New Menus and Menu Items
21.2. Linking Menu Commands
21.3. Assigning Keystrokes to a Menu Item
21.4. Summary
22. Designing Your Own Programs
22.1. Identifying the Right Problem
22.2. What Programs Do Well
22.3. Designing the Program Structure
22.3.1. The Model
22.3.2. The Controller
22.3.3. The View
22.3.4. Be Conventional
22.3.5. Be Imitative
22.3.6. Be Unusual
22.4. Thinking in Objects
22.4.1. Picking a Data Structure
22.4.2. Creating an Algorithm
22.4.3. Defining an Algorithm
22.4.4. Writing Pseudocode
22.4.5. Writing Actual Code
22.4.6. Prototyping Your Program
22.4.7. Writing and Testing Your Program
22.5. Summary
23. Working with Xcode
23.1. Creating New Folders
23.2. Fast Navigation Shortcuts
23.2.1. Using the File History Pop-Up Button
23.2.2. Using the Properties and Methods Pop-Up Button
23.2.3. Using the Classes Menu
23.2.4. Using the Include Menu
23.2.5. Switching Between the .h File and .m File
23.3. Making Code Easier to Read
23.3.1. Folding (or Unfolding) All Methods and Functions
23.3.2. Folding (or Unfolding) a Single Block of Code
23.3.3. Folding (or Unfolding) a Block of Comments
23.3.4. Unfolding Everything
23.4. Splitting the Xcode Window
23.5. Summary
24. Debugging Your Program
24.1. Debugging a Program
24.1.1. Syntax Errors
24.1.1.1. Using One = Instead of == to Compare Values
24.1.1.2. Omitting break Statements in a switch Statement
24.1.1.3. Omitting @ and *
24.1.1.4. Omitting Matching Pairs in Header (.h) and Implementation (.m) Files
24.1.2. Logic Errors
24.1.3. Run-Time Errors
24.2. Viewing Problems When Debugging
24.3. Simple Debugging Tips
24.3.1. Comment Out Your Code
24.3.2. Check the Value of Variables with NSLog
24.4. Using Breakpoints When Debugging
24.4.1. Placing (and Removing) a Breakpoint
24.4.2. Using the Debugger
24.4.3. Stepping Through Code
24.5. Summary
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
About the Author
Next
Next Chapter
Acknowledgments
About the Technical Reviewer
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset