您好,欢迎光临本网站![请登录][注册会员]  
文件名称: Objective-C 教程
  所属分类: 其它
  开发工具:
  文件大小: 3mb
  下载次数: 0
  上传时间: 2011-11-01
  提 供 者: forest1*******
 详细说明: Introduction viii Chapter 1: Getting Started: Essential Objective-C 1 Creating Your First Program. . . . . . . . . . . . . . . . . . . . . . 3 Compiling and Running Your First Program . ......... 6 Using Variables . .................................................................... 8 Displaying Values in Variables . ....................................... 9 Working with Data Types . ............................................. 11 Adding Comments . ............................................................ 13 Using Arithmeti c Operators . ......................................... 15 Using Assignment Operators . ....................................... 17 Using the Increment and Decrement Operators . ........................................... 19 Changing Type with Cast Operators . ...................... 21 Chapter 2: Directing Program Flow 23 Using the if Statement . ................................................... 26 Using the else Statement . ............................................... 27 Using the switch Statement . ......................................... 29 Using Comparison Operators . ..................................... 31 Using Logical Operators . ............................................... 32 Using the Conditional Operator . ................................ 33 Using the for Loop . ............................................................ 35 Using the while Loop . ...................................................... 37 Using the do...while Loop . ............................................. 39 Using the break Statement . ......................................... 41 Chapter 3: Handling Data 43 About Creating NS-Class Objects . .............................. 45 Creating Arrays . .................................................................. 46 Initializing Arrays . .............................................................. 47 Looping over Arrays . ........................................................ 48 Creating Two-Dimensional Arrays . .......................... 49 Using Pointers . .................................................................... 51 Using Pointer Math . .......................................................... 52 Interchanging Pointers and Arrays . .......................... 53 Using Strings . ....................................................................... 54 Passing Messages to String Objects . .......................... 56 Using Enumerations . ........................................................ 57 Table of Contents From the Library of Wow! eBook v Table of Contents Table of Contents Chapter 4: Creating Functions 59 Defining a Function . .......................................................... 61 Declaring Functions Using Prototypes . .................... 62 Passing Arguments to Functions . .............................. 64 Returning Values from Functions . .............................. 66 Using Function Scope . ...................................................... 68 Passing Pointers to Functions . ..................................... 70 Passing Arrays to Functions . ....................................... 72 Passing Constant Data to Functions . ........................ 74 Using Recursion . ................................................................ 76 Using Pointers to Functions . ....................................... 77 Chapter 5: Classes and Objects 79 Creating Objective-C Classes and Objects . ........... 82 Using Class Methods . ........................................................ 84 Creating an Object . ............................................................ 86 Creating Object Methods . ............................................. 87 Storing Data in Objects . ................................................. 88 Passing Multiple Arguments to Methods . ............. 90 Storing the Interface in a Header File . ...................... 92 Adding the Implementation to the Header File . . . 94 Linking Multiple Files . ................................................... 95 Using Constructors . .......................................................... 97 Chapter 6: Object-Oriented Programming 99 About Access Specifiers . ............................................... 100 Using Public Access . ...................................................... 102 Using Private Access . ................................................... 103 Using Protected Access . ............................................... 105 Using Class Variables . ................................................... 107 Accessing the Current Object . .................................. 109 Creating a Variable for Multiple Object Types . ............................................................ 111 Verifying That an Object Belongs to a Class .... 113 Checking an Object's Class with isKindOfClass . .......................................................... 115 Verifying That an Object Supports a Method .... 117 Checking Whether Objects Support a Method ... 118 Chapter 7: Working with Object-Oriented Inheritance 119 Inheriting from a Class . ............................................... 121 Inheriting Base-Class Data Members . ................. 122 Inheriting Base-Class Methods . .............................. 124 Overriding Base-Class Methods . .............................. 126 Overloading Base-Class Methods . .......................... 128 From the Library of Wow! eBook vi Table of Contents Table of Contents Using Multi-level Inheritance . .................................. 130 Limiting Access . .............................................................. 132 Restricting Access . .......................................................... 134 Using Constructors with Inheritance . ................. 136 Using Polymorphism . ................................................... 138 Chapter 8: Categories, Posing, and Protocols 141 About Categories . ............................................................ 143 Categories: Creating the Base Class . ...................... 145 Categories: Creating Categories . .............................. 146 Categories: Putting It All Together . .......................... 147 About Posing . .................................................................... 149 Posing: Creating the Base Class . ................................ 151 Posing: Creating the Derived Class . ........................ 152 Posing: Putting It All Together . .................................. 153 About Protocols . .............................................................. 155 Protocols: Defining the Protocol and Interfaces . ................................................................ 157 Protocols: Creating the Class Implementations . ................................................... 159 Protocols: Putting It All Together . ............................ 161 Chapter 9: Using Arrays and Dictionaries 163 Creating an Array . .......................................................... 165 Accessing Array Elements . ........................................... 166 Using Enumeration to Loop over an Array . ......... 167 Creating a Mutable Array . ........................................... 169 Adding Elements to a Mutable Array . .................... 171 Sorting an Array . .............................................................. 173 Releasing Array Memory . ............................................. 175 Creating a Dictionary . ................................................... 176 Enumerating a Dictionary . ....................................... 178 Creating a Mutable Dictionary . ................................ 180 Adding Objects to a Mutable Dictionary . ............. 181 Chapter 10: Managing Memory in Objective-C 183 Creating Test Objects . ................................................... 185 Displaying the Retain Count . ..................................... 186 Incrementing an Object’s Retain Count . ............... 188 Decrementing an Object’s Retain Count . ........... 190 Deallocating Objects from Memory . ...................... 192 Using an Autorelease Pool . ......................................... 194 Using Self-Managed Memory . .................................. 195 Deallocating Memory Yourself: Creating the Class . ..................................................................... 197 From the Library of Wow! eBook vii Table of Contents Table of Contents Deallocating Memory Yourself: Storing Internal Objects . ...................................................... 198 Deallocating Memory Yourself: Creating the main Method . ................................................... 200 Deallocating Memory Yourself: Performing Deallocation . ............................................................ 201 Chapter 11: Exception Handling 203 Catching Exceptions . ...................................................... 205 Handling Exceptions . ...................................................... 206 Using the End Handler . ................................................. 207 Creating an Exception . ................................................. 209 Checking What Exception Occurred . .................... 211 Handling Multiple Exceptions . .................................. 213 Passing Exceptions Up the Call Stack . .................... 215 Returning Values from Exception Handlers . ....... 217 Returning void from an Exception Handler . ....... 219 Catching Uncaught Exceptions . .............................. 221 ...展开收缩
(系统自动生成,下载前可以参看下载内容)

下载文件列表

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度
  • 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.
 相关搜索: Objective-C
 输入关键字,在本站1000多万海量源码库中尽情搜索: