Muutke küpsiste eelistusi

E-raamat: Programming in Objective-C

  • Formaat: PDF+DRM
  • Sari: Developer's Library
  • Ilmumisaeg: 01-Dec-2011
  • Kirjastus: Addison-Wesley Educational Publishers Inc
  • Keel: eng
  • ISBN-13: 9780132900881
  • Formaat - PDF+DRM
  • Hind: 24,85 €*
  • * hind on lõplik, st. muud allahindlused enam ei rakendu
  • Lisa ostukorvi
  • Lisa soovinimekirja
  • See e-raamat on mõeldud ainult isiklikuks kasutamiseks. E-raamatuid ei saa tagastada.
  • Formaat: PDF+DRM
  • Sari: Developer's Library
  • Ilmumisaeg: 01-Dec-2011
  • Kirjastus: Addison-Wesley Educational Publishers Inc
  • Keel: eng
  • ISBN-13: 9780132900881

DRM piirangud

  • Kopeerimine (copy/paste):

    ei ole lubatud

  • Printimine:

    ei ole lubatud

  • Kasutamine:

    Digitaalõiguste kaitse (DRM)
    Kirjastus on väljastanud selle e-raamatu krüpteeritud kujul, mis tähendab, et selle lugemiseks peate installeerima spetsiaalse tarkvara. Samuti peate looma endale  Adobe ID Rohkem infot siin. E-raamatut saab lugeda 1 kasutaja ning alla laadida kuni 6'de seadmesse (kõik autoriseeritud sama Adobe ID-ga).

    Vajalik tarkvara
    Mobiilsetes seadmetes (telefon või tahvelarvuti) lugemiseks peate installeerima selle tasuta rakenduse: PocketBook Reader (iOS / Android)

    PC või Mac seadmes lugemiseks peate installima Adobe Digital Editionsi (Seeon tasuta rakendus spetsiaalselt e-raamatute lugemiseks. Seda ei tohi segamini ajada Adober Reader'iga, mis tõenäoliselt on juba teie arvutisse installeeritud )

    Seda e-raamatut ei saa lugeda Amazon Kindle's. 

Programming in Objective-C, Fourth Edition

Updated for iOS 5 and ARC



Programming in Objective-C is a concise, carefully written tutorial on the basics of Objective-C and object-oriented programming for Apple's iOS and Mac platforms.

The book makes no assumptions about prior experience with object-oriented programming languages or with the C language (which Objective-C is based upon). Because of this, both beginners and experienced programmers alike can use this book to quickly and effectively learn the fundamentals of Objective-C.

Readers can also learn the concepts of object-oriented programming without having to first learn all of the intricacies of the underlying C programming language. This unique approach to learning, combined with many small program examples and exercises at the end of each chapter, makes Programming in Objective-C ideally suited for either classroom use or self-study.

The fourth edition of this book has been updated to cover the significant changes that first appeared in iOS 5 and Xcode 4.2, including the use of Automatic Reference Counting (ARC) to improve and simplify memory management in Objective-C programs.



The best book on any programming language that Ive ever read. If you want to learn Objective-C, buy it.Calvin Wolcott



An excellent resource for a new programmer who wants to learn Objective-C as their first programming languagea woefully underserved market.Pat Hughes



Table of Contents

1 Introduction

2 Programming in Objective-C

3 Classes, Objects, and Methods

4 Data Types and Expressions

5 Program Looping

6 Making Decisions

7 More on Classes

8 Inheritance

9 Polymorphism, Dynamic Typing, and Dynamic Binding

10 More on Variables and Data Types

11 Categories and Protocols

12 The Preprocessor

13 Underlying C Language Features

14 Introduction to the Foundation Framework

15 Numbers, Strings, and Collections

16 Working with Files

17 Memory Management and Automatic Reference Counting

18 Copying Objects

19 Archiving

20 Introduction to Cocoa and Cocoa Touch

21 Writing iOS Applications

A Glossary

B Address Book Example Source Code
1 Introduction 1(6)
What You Will Learn from This Book
2(1)
How This Book Is Organized
3(2)
Support
5(1)
Acknowledgments
5(1)
Preface to the Fourth Edition
6(1)
2 Programming in Objective-C 7(20)
Compiling and Running Programs
7(12)
Using Xcode
8(9)
Using Terminal
17(2)
Explanation of Your First Program
19(4)
Displaying the Values of Variables
23(2)
Summary
25(1)
Exercises
25(2)
3 Classes, Objects, and Methods 27(24)
What Is an Object, Anyway?
27(1)
Instances and Methods
28(2)
An Objective-C Class for Working with Fractions
30(3)
The @interface Section
33(4)
Choosing Names
34(1)
Class and Instance Methods
35(2)
The @implementation Section
37(2)
The program Section
39(6)
Accessing Instance Variables and Data Encapsulation
45(4)
Summary
49(1)
Exercises
49(2)
4 Data Types and Expressions 51(20)
Data Types and Constants
51(4)
Type int
51(1)
Type float
52(1)
Type char
52(1)
Qualifiers: long, long long, short, unsigned, and signed
53(1)
Type id
54(1)
Arithmetic Expressions
55(9)
Operator Precedence
55(3)
Integer Arithmetic and the Unary Minus Operator
58(2)
The Modulus Operator
60(1)
Integer and Floating-Point Conversions
61(2)
The Type Cast Operator
63(1)
Assignment Operators
64(1)
A Calculator Class
65(2)
Exercises
67(4)
5 Program Looping 71(22)
The for Statement
72(12)
Keyboard Input
79(2)
Nested for Loops
81(2)
for Loop Variants
83(1)
The while Statement
84(4)
The do Statement
88(2)
The break Statement
90(1)
The continue Statement
90(1)
Summary
91(1)
Exercises
91(2)
6 Making Decisions 93(34)
The if Statement
93(21)
The if-else Construct
98(2)
Compound Relational Tests
100(3)
Nested if Statements
103(2)
The else if Construct
105(9)
The switch Statement
114(3)
Boolean Variables
117(5)
The Conditional Operator
122(2)
Exercises
124(3)
7 More on Classes 127(24)
Separate Interface and Implementation Files
127(5)
Synthesized Accessor Methods
132(2)
Accessing Properties Using the Dot Operator
134(1)
Multiple Arguments to Methods
135(5)
Methods Without Argument Names
137(1)
Operations on Fractions
137(3)
Local Variables
140(5)
Method Arguments
141(1)
The static Keyword
141(4)
The self Keyword
145(1)
Allocating and Returning Objects from Methods
146(2)
Extending Class Definitions and the Interface File
148(1)
Exercises
148(3)
8 Inheritance 151(26)
It All Begins at the Root
151(5)
Finding the Right Method
155(1)
Extension Through Inheritance: Adding New Methods
156(13)
A Point Class and Object Allocation
160(1)
The @class Directive
161(4)
Classes Owning Their Objects
165(4)
Overriding Methods
169(4)
Which Method Is Selected?
171(2)
Abstract Classes
173(1)
Exercises
174(3)
9 Polymorphism, Dynamic Typing, and Dynamic Binding 177(18)
Polymorphism: Same Name, Different Class
177(3)
Dynamic Binding and the id Type
180(2)
Compile Time Versus Runtime Checking
182(1)
The id Data Type and Static Typing
183(2)
Argument and Return Types with Dynamic Typing
184(1)
Asking Questions About Classes
185(4)
Exception Handling Using @try
189(3)
Exercises
192(3)
10 More on Variables and Data Types 195(24)
Initializing Objects
195(3)
Scope Revisited
198(7)
Directives for Controlling Instance Variable Scope
198(2)
More on Properties, Synthesized Accessors, and Instance Variables
200(1)
Global Variables
200(2)
Static Variables
202(3)
Enumerated Data Types
205(3)
The typedef Statement
208(1)
Data Type Conversions
209(2)
Conversion Rules
210(1)
Bit Operators
211(6)
The Bitwise AND Operator
212(1)
The Bitwise Inclusive-OR Operator
213(1)
The Bitwise Exclusive-OR Operator
214(1)
The Ones Complement Operator
214(2)
The Left Shift Operator
216(1)
The Right Shift Operator
216(1)
Exercises
217(2)
11 Categories and Protocols 219(14)
Categories
219(5)
Class Extensions
224(2)
Some Notes About Categories
225(1)
Protocols and Delegation
226(4)
Delegation
229(1)
Informal Protocols
229(1)
Composite Objects
230(1)
Exercises
231(2)
12 The Preprocessor 233(14)
The #define Statement
233(7)
More Advanced Types of Definitions
235(5)
The #import Statement
240(1)
Conditional Compilation
241(4)
The #ifdef, #endif, #else
241(2)
The #if and #elif Preprocessor Statements
243(1)
The #undef Statement
244(1)
Exercises
245(2)
13 Underlying C Language Features 247(56)
Arrays
248(6)
Initializing Array Elements
250(1)
Character Arrays
251(1)
Multidimensional Arrays
252(2)
Functions
254(8)
Arguments and Local Variables
255(2)
Returning Function Results
257(4)
Functions, Methods, and Arrays
261(1)
Blocks
262(4)
Structures
266(7)
Initializing. Structures
269(1)
Structures Within Structures
270(2)
Additional Details About Structures
272(1)
Don't Forget About Object-Oriented Programming!
273(1)
Pointers
273(20)
Pointers and Structures
277(2)
Pointers, Methods, and Functions
279(1)
Pointers and Arrays
280(6)
Constant Character Strings and Pointers
286(4)
Operations on Pointers
290(2)
Pointers and Memory Addresses
292(1)
They're Not Objects!
293(1)
Miscellaneous Language Features
293(5)
Compound Literals
293(1)
The goto Statement
294(1)
The null Statement
294(1)
The Comma Operator
294(1)
The sizeof Operator
295(1)
Command-Line Arguments
296(2)
How Things Work
298(2)
Fact #1: Instance Variables Are Stored in Structures
298(1)
Fact #2: An Object Variable Is Really a Pointer
299(1)
Fact #3: Methods Are Functions, and Message Expressions Are Function Calls
299(1)
Fact #4: The id Type Is a Generic Pointer Type
299(1)
Exercises
300(3)
14 Introduction to the Foundation Framework 303(4)
Foundation Documentation
303(4)
15 Numbers, Strings, and Collections 307(62)
Number Objects
307(5)
String Objects
312(15)
More on the NSLog Function
312(1)
The description Method
313(1)
Mutable Versus Immutable Objects
314(6)
Mutable Strings
320(7)
Array Objects
327(27)
Making an Address Book
330(17)
Sorting Arrays
347(7)
Dictionary Objects
354(4)
Enumerating a Dictionary
355(3)
Set Objects
358(7)
NSIndexSet
362(3)
Exercises
365(4)
16 Working with Files 369(30)
Managing Files and Directories: NSFileManager
370(11)
Working with the NSData Class
375(1)
Working with Directories
376(3)
Enumerating the Contents of a Directory
379(2)
Working with Paths: NSPathUtilities.h
381(9)
Common Methods for Working with Paths
383(3)
Copying Files and Using the NSProcessInfo Class
386(4)
Basic File Operations: NSFileHandle
390(5)
The NSURL Class
395(1)
The NSBundle Class
396(1)
Exercises
397(2)
17 Memory Management and Automatic Reference Counting 399(14)
Automatic Garbage Collection
401(1)
Manual Reference Counting
402(3)
Object References and the Autorelease Pool
403(2)
The Event Loop and Memory Allocation
405(2)
Summary of Manual Memory Management Rules
407(1)
Automatic Reference Counting (ARC)
408(1)
Strong Variables
408(1)
Weak Variables
409(1)
@autoreleasepool Blocks
410(1)
Method Names and Non-ARC Compiled Code
411(2)
18 Copying Objects 413(12)
The copy and mutableCopy Methods
413(3)
Shallow Versus Deep Copying
416(2)
Implementing the <NSCopying> Protocol
418(3)
Copying Objects in Setter and Getter Methods
421(2)
Exercises
423(2)
19 Archiving 425(18)
Archiving with XML Property Lists
425(2)
Archiving with NSKeyedArchiver
427(2)
Writing Encoding and Decoding Methods
429(7)
Using NSData to Create Custom Archives
436(3)
Using the Archiver to Copy Objects
439(2)
Exercises
441(2)
20 Introduction to Cocoa and Cocoa Touch 443(4)
Framework Layers
443(1)
Cocoa Touch
444(3)
21 Writing iOS Applications 447(32)
The iOS SDK
447(1)
Your First iPhone Application
447(14)
Creating a New iPhone Application Project
449(3)
Entering Your Code
452(3)
Designing the Interface
455(6)
An iPhone Fraction Calculator
461(14)
Starting the New Fraction_Calculator Project
462(2)
Defining the View Controller
464(5)
The Fraction Class
469(4)
A Calculator Class That Deals with Fractions
473(1)
Designing the UI
474(1)
Summary
475(1)
Exercises
476(3)
A Glossary 479(8)
B Address Book Example Source Code 487(6)
Index 493
Stephen Kochan is the author and coauthor of several bestselling titles on the C language, including Programming in C (Sams, 2004), Programming in ANSI C (Sams, 1994), and Topics in C Programming (Wiley, 1991), and several Unix titles, including Exploring the Unix System (Sams, 1992) and Unix Shell Programming (Sams, 2003). He has been programming on Macintosh computers since the introduction of the first Mac in 1984, and he wrote Programming C for the Mac as part of the Apple Press Library. In 2003 Kochan wrote Programming in Objective-C (Sams, 2003), and followed that with another Mac-related title, Beginning AppleScript (Wiley, 2004).