没有合适的资源?快使用搜索试试~ 我知道了~
objective-c语言教程
4星 · 超过85%的资源 需积分: 0 10 下载量 31 浏览量
2012-11-02
13:45:49
上传
评论 1
收藏 815KB PDF 举报
温馨提示
试读
106页
objective-c语言教程。最新原版资料。内有基本语法,类对象使用,也有协议、线程等的介绍和使用等。是iphone开发的基础资料
资源推荐
资源详情
资源评论
The Objective-C
Programming Language
Contents
Introduction 7
Who Should Read This Document 7
Organization of This Document 8
Conventions 8
See Also 9
The Runtime System 9
Memory Management 9
Objects, Classes, and Messaging 10
The Runtime System 10
Objects 10
Object Basics 10
id 11
Dynamic Typing 11
Memory Management 12
Object Messaging 12
Message Syntax 13
Sending Messages to nil 15
The Receiver’s Instance Variables 16
Polymorphism 16
Dynamic Binding 17
Dynamic Method Resolution 17
Dot Syntax 17
Classes 19
Inheritance 19
Class Types 23
Class Objects 25
Class Names in Source Code 30
Testing Class Equality 31
Defining a Class 33
Source Files 33
Class Interface 34
Importing the Interface 35
2011-10-12 | © 2011 Apple Inc. All Rights Reserved.
2
Referring to Other Classes 36
The Role of the Interface 37
Class Implementation 37
Referring to Instance Variables 39
The Scope of Instance Variables 40
Messages to self and super 43
An Example: Using self and super 45
Using super 47
Redefining self 47
Protocols 50
Declaring Interfaces for Others to Implement 50
Methods for Others to Implement 51
Declaring Interfaces for Anonymous Objects 52
Nonhierarchical Similarities 53
Formal Protocols 54
Declaring a Protocol 54
Optional Protocol Methods 54
Informal Protocols 55
Protocol Objects 56
Adopting a Protocol 57
Conforming to a Protocol 57
Type Checking 58
Protocols Within Protocols 59
Referring to Other Protocols 60
Declared Properties 62
Overview 62
Property Declaration and Implementation 62
Property Declaration 63
Property Declaration Attributes 64
Property Implementation Directives 67
Using Properties 69
Supported Types 69
Property Redeclaration 69
Core Foundation 70
Subclassing with Properties 70
Runtime Difference 71
Categories and Extensions 73
2011-10-12 | © 2011 Apple Inc. All Rights Reserved.
3
Contents
Adding Methods to Classes 73
Extensions 74
Associative References 76
Creating Associations 76
Retrieving Associated Objects 77
Breaking Associations 77
Complete Example 78
Fast Enumeration 80
The for…in Syntax 80
Adopting Fast Enumeration 81
Using Fast Enumeration 81
Enabling Static Behavior 83
Default Dynamic Behavior 83
Static Typing 83
Type Checking 85
Return and Parameter Types 85
Static Typing to an Inherited Class 86
Selectors 88
Methods and Selectors 88
SEL and @selector 88
Methods and Selectors 89
Method Return and Parameter Types 89
Varying the Message at Runtime 89
The Target-Action Design Pattern 90
Avoiding Messaging Errors 91
Exception Handling 93
Enabling Exception-Handling 93
Exception Handling 93
Catching Different Types of Exception 94
Throwing Exceptions 95
Threading 96
Document Revision History 98
2011-10-12 | © 2011 Apple Inc. All Rights Reserved.
4
Contents
剩余105页未读,继续阅读
资源评论
- yutangalison2013-03-09谢谢,很基础,适合初学者
- new_coming2013-01-05就是英文的,看不懂呀!
- linglong4082012-12-28一本不错的教程
sunxiao2010n
- 粉丝: 0
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功