Programming in Objective-C
Stephen G. Kochanقیمت نهایی
۴۴٬۰۰۰ تومان۴۹٬۰۰۰ تومان۱۰٪ تخفیف
- تخفیف زماندار−۵٬۰۰۰ تومان
۵٬۰۰۰ تومان صرفهجویی نسبت به قیمت اصلی
نسخه اصلی و اورجینال
بلافاصله پس از خرید، فایل کتاب روی دستگاه شما آمادهٔ دانلود است.
تحویل فوری
پرداخت امن
ضمانت فایل
پشتیبانی
مشخصات کتاب
- نویسنده
- Stephen G. Kochan
- ناشر
- Pearson
- سال انتشار
- ۲۰۱۲
- فرمت
- زبان
- انگلیسی
- حجم فایل
- ۴٫۷ مگابایت
دربارهٔ کتاب
Contents......Page 8 1 Introduction......Page 18 What You Will Learn from This Book......Page 19 How This Book Is Organized......Page 20 Acknowledgments......Page 22 Preface to the Fourth Edition......Page 23 Compiling and Running Programs......Page 24 Using Xcode......Page 25 Using Terminal......Page 34 Explanation of Your First Program......Page 36 Displaying the Values of Variables......Page 40 Exercises......Page 42 What Is an Object, Anyway?......Page 44 Instances and Methods......Page 45 An Objective-C Class for Working with Fractions......Page 47 The @interface Section......Page 50 Choosing Names......Page 51 Class and Instance Methods......Page 52 The @implementation Section......Page 54 The program Section......Page 56 Accessing Instance Variables and Data Encapsulation......Page 62 Exercises......Page 66 Type int......Page 68 Type char......Page 69 Qualifiers: long, long long, short, unsigned, and signed......Page 70 Type id......Page 71 Operator Precedence......Page 72 Integer Arithmetic and the Unary Minus Operator......Page 75 The Modulus Operator......Page 77 Integer and Floating-Point Conversions......Page 78 The Type Cast Operator......Page 80 Assignment Operators......Page 81 A Calculator Class......Page 82 Exercises......Page 84 5 Program Looping......Page 88 The for Statement......Page 89 Keyboard Input......Page 96 Nested for Loops......Page 98 For Loop Variants......Page 100 The while Statement......Page 101 The do Statement......Page 105 The continue Statement......Page 107 Exercises......Page 108 The if Statement......Page 110 The if-else Construct......Page 115 Compound Relational Tests......Page 117 Nested if Statements......Page 120 The else if Construct......Page 122 The switch Statement......Page 131 Boolean Variables......Page 134 The Conditional Operator......Page 139 Exercises......Page 141 Separate Interface and Implementation Files......Page 144 Synthesized Accessor Methods......Page 149 Accessing Properties Using the Dot Operator......Page 151 Multiple Arguments to Methods......Page 152 Operations on Fractions......Page 154 Local Variables......Page 157 The static Keyword......Page 158 The self Keyword......Page 162 Allocating and Returning Objects from Methods......Page 163 Exercises......Page 165 It All Begins at the Root......Page 168 Finding the Right Method......Page 172 Extension Through Inheritance: Adding New Methods......Page 173 A Point Class and Object Allocation......Page 177 The @class Directive......Page 178 Classes Owning Their Objects......Page 182 Overriding Methods......Page 186 Which Method Is Selected?......Page 188 Abstract Classes......Page 190 Exercises......Page 191 Polymorphism: Same Name, Different Class......Page 194 Dynamic Binding and the id Type......Page 197 Compile Time Versus Runtime Checking......Page 199 The id Data Type and Static Typing......Page 200 Argument and Return Types with Dynamic Typing......Page 201 Asking Questions About Classes......Page 202 Exception Handling Using @try......Page 206 Exercises......Page 209 Initializing Objects......Page 212 Directives for Controlling Instance Variable Scope......Page 215 Global Variables......Page 217 Static Variables......Page 219 Enumerated Data Types......Page 222 The typedef Statement......Page 225 Data Type Conversions......Page 226 Conversion Rules......Page 227 Bit Operators......Page 228 The Bitwise AND Operator......Page 229 The Bitwise Inclusive-OR Operator......Page 230 The Ones Complement Operator......Page 231 The Right Shift Operator......Page 233 Exercises......Page 234 Categories......Page 236 Class Extensions......Page 241 Some Notes About Categories......Page 242 Protocols and Delegation......Page 243 Informal Protocols......Page 246 Composite Objects......Page 247 Exercises......Page 248 The #define Statement......Page 250 More Advanced Types of Definitions......Page 252 The #import Statement......Page 257 The #ifdef, #endif, #else......Page 258 The #if and #elif Preprocessor Statements......Page 260 The #undef Statement......Page 261 Exercises......Page 262 13 Underlying C Language Features......Page 264 Arrays......Page 265 Initializing Array Elements......Page 267 Character Arrays......Page 268 Multidimensional Arrays......Page 269 Functions......Page 271 Arguments and Local Variables......Page 272 Returning Function Results......Page 274 Functions, Methods, and Arrays......Page 278 Blocks......Page 279 Structures......Page 283 Initializing Structures......Page 286 Structures Within Structures......Page 287 Additional Details About Structures......Page 289 Pointers......Page 290 Pointers and Structures......Page 294 Pointers, Methods, and Functions......Page 296 Pointers and Arrays......Page 297 Constant Character Strings and Pointers......Page 303 Operations on Pointers......Page 307 Pointers and Memory Addresses......Page 309 Compound Literals......Page 310 The Comma Operator......Page 311 The sizeof Operator......Page 312 Command-Line Arguments......Page 313 Fact #1: Instance Variables Are Stored in Structures......Page 315 Fact #4: The id Type Is a Generic Pointer Type......Page 316 Exercises......Page 317 Foundation Documentation......Page 320 Number Objects......Page 324 More on the NSLog Function......Page 329 The description Method......Page 330 Mutable Versus Immutable Objects......Page 331 Mutable Strings......Page 337 Array Objects......Page 344 Making an Address Book......Page 347 Sorting Arrays......Page 364 Dictionary Objects......Page 371 Enumerating a Dictionary......Page 372 Set Objects......Page 375 NSIndexSet......Page 379 Exercises......Page 382 16 Working with Files......Page 386 Managing Files and Directories: NSFileManager......Page 387 Working with the NSData Class......Page 392 Working with Directories......Page 393 Enumerating the Contents of a Directory......Page 396 Working with Paths: NSPathUtilities.h......Page 398 Common Methods for Working with Paths......Page 400 Copying Files and Using the NSProcessInfo Class......Page 403 Basic File Operations: NSFileHandle......Page 407 The NSURL Class......Page 412 The NSBundle Class......Page 413 Exercises......Page 414 17 Memory Management and Automatic Reference Counting......Page 416 Automatic Garbage Collection......Page 418 Manual Reference Counting......Page 419 Object References and the Autorelease Pool......Page 420 The Event Loop and Memory Allocation......Page 422 Summary of Manual Memory Management Rules......Page 424 Strong Variables......Page 425 Weak Variables......Page 426 @autoreleasepool Blocks......Page 427 Method Names and Non-ARC Compiled Code......Page 428 The copy and mutableCopy Methods......Page 430 Shallow Versus Deep Copying......Page 433 Implementing the Protocol......Page 435 Copying Objects in Setter and Getter Methods......Page 438 Exercises......Page 440 Archiving with XML Property Lists......Page 442 Archiving with NSKeyedArchiver......Page 444 Writing Encoding and Decoding Methods......Page 446 Using NSData to Create Custom Archives......Page 453 Using the Archiver to Copy Objects......Page 456 Exercises......Page 458 Framework Layers......Page 460 Cocoa Touch......Page 461 Your First iPhone Application......Page 464 Creating a New iPhone Application Project......Page 466 Entering Your Code......Page 469 Designing the Interface......Page 472 An iPhone Fraction Calculator......Page 478 Starting the New Fraction_Calculator Project......Page 479 Defining the View Controller......Page 481 The Fraction Class......Page 486 A Calculator Class That Deals with Fractions......Page 490 Designing the UI......Page 491 Summary......Page 492 Exercises......Page 493 A......Page 496 C......Page 497 F......Page 498 I......Page 499 P......Page 500 S......Page 501 Z......Page 502 B: Address Book Example Source Code......Page 504 Index......Page 510 A......Page 511 C......Page 515 D......Page 521 E......Page 525 F......Page 526 G......Page 531 I......Page 532 L......Page 537 M......Page 538 N......Page 544 O......Page 546 P......Page 548 R......Page 552 S......Page 554 U......Page 558 V......Page 559 X......Page 560 Z......Page 561 Contents 8 1 Introduction 18 What You Will Learn from This Book 19 How This Book Is Organized 20 Support 22 Acknowledgments 22 Preface to the Fourth Edition 23 2 Programming in Objective-C 24 Compiling and Running Programs 24 Using Xcode 25 Using Terminal 34 Explanation of Your First Program 36 Displaying the Values of Variables 40 Summary 42 Exercises 42 3 Classes, Objects, and Methods 44 What Is an Object, Anyway? 44 Instances and Methods 45 An Objective-C Class for Working with Fractions 47 The @interface Section 50 Choosing Names 51 Class and Instance Methods 52 The @implementation Section 54 The program Section 56 Accessing Instance Variables and Data Encapsulation 62 Summary 66 Exercises 66 4 Data Types and Expressions 68 Data Types and Constants 68 Type int 68 Type float 69 Type char 69 Qualifiers: long, long long, short, unsigned, and signed 70 Type id 71 Arithmetic Expressions 72 Operator Precedence 72 Integer Arithmetic and the Unary Minus Operator 75 The Modulus Operator 77 Integer and Floating-Point Conversions 78 The Type Cast Operator 80 Assignment Operators 81 A Calculator Class 82 Exercises 84 5 Program Looping 88 The for Statement 89 Keyboard Input 96 Nested for Loops 98 For Loop Variants 100 The while Statement 101 The do Statement 105 The break Statement 107 The continue Statement 107 Summary 108 Exercises 108 6 Making Decisions 110 The if Statement 110 The if-else Construct 115 Compound Relational Tests 117 Nested if Statements 120 The else if Construct 122 The switch Statement 131 Boolean Variables 134 The Conditional Operator 139 Exercises 141 7 More on Classes 144 Separate Interface and Implementation Files 144 Synthesized Accessor Methods 149 Accessing Properties Using the Dot Operator 151 Multiple Arguments to Methods 152 Methods Without Argument Names 154 Operations on Fractions 154 Local Variables 157 Method Arguments 158 The static Keyword 158 The self Keyword 162 Allocating and Returning Objects from Methods 163 Extending Class Definitions and the Interface File 165 Exercises 165 8 Inheritance 168 It All Begins at the Root 168 Finding the Right Method 172 Extension Through Inheritance: Adding New Methods 173 A Point Class and Object Allocation 177 The @class Directive 178 Classes Owning Their Objects 182 Overriding Methods 186 Which Method Is Selected? 188 Abstract Classes 190 Exercises 191 9 Polymorphism, Dynamic Typing, and Dynamic Binding 194 Polymorphism: Same Name, Different Class 194 Dynamic Binding and the id Type 197 Compile Time Versus Runtime Checking 199 The id Data Type and Static Typing 200 Argument and Return Types with Dynamic Typing 201 Asking Questions About Classes 202 Exception Handling Using @try 206 Exercises 209 10 More on Variables and Data Types 212 Initializing Objects 212 Scope Revisited 215 Directives for Controlling Instance Variable Scope 215 More on Properties, Synthesized Accessors, and Instance Variables 217 Global Variables 217 Static Variables 219 Enumerated Data Types 222 The typedef Statement 225 Data Type Conversions 226 Conversion Rules 227 Bit Operators 228 The Bitwise AND Operator 229 The Bitwise Inclusive-OR Operator 230 The Bitwise Exclusive-OR Operator 231 The Ones Complement Operator 231 The Left Shift Operator 233 The Right Shift Operator 233 Exercises 234 11 Categories and Protocols 236 Categories 236 Class Extensions 241 Some Notes About Categories 242 Protocols and Delegation 243 Delegation 246 Informal Protocols 246 Composite Objects 247 Exercises 248 12 The Preprocessor 250 The #define Statement 250 More Advanced Types of Definitions 252 The #import Statement 257 Conditional Compilation 258 The #ifdef, #endif, #else 258 The #if and #elif Preprocessor Statements 260 The #undef Statement 261 Exercises 262 13 Underlying C Language Features 264 Arrays 265 Initializing Array Elements 267 Character Arrays 268 Multidimensional Arrays 269 Functions 271 Arguments and Local Variables 272 Returning Function Results 274 Functions, Methods, and Arrays 278 Blocks 279 Structures 283 Initializing Structures 286 Structures Within Structures 287 Additional Details About Structures 289 Don鈥檛 Forget About Object-Oriented Programming! 290 Pointers 290 Pointers and Structures 294 Pointers, Methods, and Functions 296 Pointers and Arrays 297 Constant Character Strings and Pointers 303 Operations on Pointers 307 Pointers and Memory Addresses 309 They鈥檙e Not Objects! 310 Miscellaneous Language Features 310 Compound Literals 310 The goto Statement 311 The null Statement 311 The Comma Operator 311 The sizeof Operator 312 Command-Line Arguments 313 How Things Work 315 Fact #1: Instance Variables Are Stored in Structures 315 Fact #2: An Object Variable Is Really a Pointer 316 Fact #3: Methods Are Functions, and Message Expressions Are Function Calls 316 Fact #4: The id Type Is a Generic Pointer Type 316 Exercises 317 14 Introduction to the Foundation Framework 320 Foundation Documentation 320 15 Numbers, Strings, and Collections 324 Number Objects 324 String Objects 329 More on the NSLog Function 329 The description Method 330 Mutable Versus Immutable Objects 331 Mutable Strings 337 Array Objects 344 Making an Address Book 347 Sorting Arrays 364 Dictionary Objects 371 Enumerating a Dictionary 372 Set Objects 375 NSIndexSet 379 Exercises 382 16 Working with Files 386 Managing Files and Directories: NSFileManager 387 Working with the NSData Class 392 Working with Directories 393 Enumerating the Contents of a Directory 396 Working with Paths: NSPathUtilities.h 398 Common Methods for Working with Paths 400 Copying Files and Using the NSProcessInfo Class 403 Basic File Operations: NSFileHandle 407 The NSURL Class 412 The NSBundle Class 413 Exercises 414 17 Memory Management and Automatic Reference Counting 416 Automatic Garbage Collection 418 Manual Reference Counting 419 Object References and the Autorelease Pool 420 The Event Loop and Memory Allocation 422 Summary of Manual Memory Management Rules 424 Automatic Reference Counting (ARC) 425 Strong Variables 425 Weak Variables 426 @autoreleasepool Blocks 427 Method Names and Non-ARC Compiled Code 428 18 Copying Objects 430 The copy and mutableCopy Methods 430 Shallow Versus Deep Copying 433 Implementing the Protocol 435 Copying Objects in Setter and Getter Methods 438 Exercises 440 19 Archiving 442 Archiving with XML Property Lists 442 Archiving with NSKeyedArchiver 444 Writing Encoding and Decoding Methods 446 Using NSData to Create Custom Archives 453 Using the Archiver to Copy Objects 456 Exercises 458 20 Introduction to Cocoa and Cocoa Touch 460 Framework Layers 460 Cocoa Touch 461 21 Writing iOS Applications 464 The iOS SDK 464 Your First iPhone Application 464 Creating a New iPhone Application Project 466 Entering Your Code 469 Designing the Interface 472 An iPhone Fraction Calculator 478 Starting the New Fraction_Calculator Project 479 Defining the View Controller 481 The Fraction Class 486 A Calculator Class That Deals with Fractions 490 Designing the UI 491 Summary 492 Exercises 493 A: Glossary 496 A 496 B 497 C 497 D 498 E 498 F 498 G 499 H 499 I 499 L 500 M 500 N 500 O 500 P 500 R 501 S 501 U 502 X 502 Z 502 B: Address Book Example Source Code 504 Index 510 A 511 B 515 C 515 D 521 E 525 F 526 G 531 H 532 I 532 K 537 L 537 M 538 N 544 O 546 P 548 Q 552 R 552 S 554 T 558 U 558 V 559 W 560 X 560 Z 561
کتابهای مشابه
Programming in Objective- C
۴۹٬۰۰۰ تومان
Programming in Objective- C
۴۹٬۰۰۰ تومان
Object-Oriented Programming with Objective-C
۴۹٬۰۰۰ تومان
Objective-C Programming For Dummies
۴۹٬۰۰۰ تومان
Object-oriented programming in C++
۴۹٬۰۰۰ تومان
Object-oriented programming in C++
۴۹٬۰۰۰ تومان
The Objective-C Programming Language
۴۹٬۰۰۰ تومان
Programming in Objective-C 2.0
۴۹٬۰۰۰ تومان
Object Oriented Programming With C++
۴۹٬۰۰۰ تومان
Objective-C programming for dummies
۴۹٬۰۰۰ تومان
Object Oriented Programming in C++
۴۹٬۰۰۰ تومان
Object Oriented Programming in C++
۴۹٬۰۰۰ تومان
قیمت نهایی
۴۴٬۰۰۰ تومان
