声明:本文档仅为个人学习过程中顺手翻译之作,方便开发的同胞借鉴参考。如有觉得译的不好不到位的地方,欢迎指正,将及时做出更正
尽量尊重原文档,因为首次Objective-C,有些地方可能直译了没有注意该语言的专有词,希望指正。如需转载,请注明出处

我的编程环境:
IDE:XCODE4.3.1
OS: MAC OS X 10.7.4
文章来译自:http://developer.apple.com/

简介

Objective-C语言是一种简单的基于当下先进的面向对象的一种计算机语言。它作为标准的ANSI C语言的扩展,轻量但很强大。相对C, Objective-C新加入的一些内容更多是基于Smalltalk语言,Smalltalk是面向对象编程语言的创始者之一。Obejctive-C被设计赋予C语言完整的面向对象编程的能力,并以一种简单和直接的方式来实现。
大多数面向对象的开发环境都包含下列几部分:
  • 面向对象的编程语言;
  • 一系列的对象库;
  • 一套开发工具;
  • 运行时环境;

本文档是关于第一个部分的介绍,即编程语言。 本文档还包含了一些有关学习第二部分的基础知识--Objective-C应用框架--Cocoa,运行时环境的表述可以参考另外一个文档Objective-C Runtime Programming Guide.

适合阅读本文档的人群:
1.Objective-C的开发人员
2.想要了解Cocoa应用框架基础的朋友
本文档不仅介绍了Obejctive-C的面向对象模型以及语言本身。专注于讲解相对C扩展的东西,而不是C本身。
因为文档并不着墨于C语言本身,可能有人觉得需要具备C的知识背景呢。作为一个面向对象的语言,Objective-C是跟面向过程的C有着很大的区别,所以即便你不是一个有经验的C语言开发者,也不会妨碍你学习Objective-C
本文档的组织结构:
  • “Objects, Classes, and Messaging” (对象,类 以及 消息)

  • “Defining a Class” (如何定义类)

  • “Protocols” (协议/规则)

  • “Declared Properties”  (如何声明属性)

  • “Categories and Extensions” (类目及扩展)

  • “Associative References”   (关联引用)

  • “Fast Enumeration” (迅捷枚举)

  • “Enabling Static Behavior” (使用静态成员)

  • “Selectors” (筛选器)

  • “Exception Handling” (异常处理)

  • “Threading” (线程)

关于文字字体协定的内容不做翻译了,呵呵,只是一些书写惯例
其它:
如果你从来没有使用过面向对象的语言进行过开发,那么你可以先阅读下文档Object-Oriented Programming with Objective-C. 同样,如果你有过面向对象开发的经验,例如,C++, JAVA等语言的开发经验,你也可以看下上面提到的文档, 因为他们虽然都是面向对象的,但很多内容可能不尽相同。这个文档讲述了面向对象开发的思想以及一些基于面向对象思想的实现。
运行时环境
Objective-C Runtime Programming Guide 这个文档向我们讲解了有关Objective-C的运行时环境,以及我们如何使用。
Objective-C Runtime Reference 这个文档则向我们介绍了Objective-C说支持的数据结构以及函数。你的程序也许会用到里面的借口来与Objective-C运行时环境进行交互。
内存管理
Objective-C支持三种方式的内存管理:自动垃圾回收及引用统计
  • Automatic Reference Counting (ARC), 自动引用统计,编译器会推断出所有对象的生命周期

  • Manual Reference Counting (MRC), 手动引用统计,有时也叫MRR,即手动保持,释放。用于你完全掌控并决定对象的生命周期。

    详情可以参考 Advanced Memory Management Programming Guide.

  • Garbage collection, 垃圾回收,将决定对象生命周期的责任传递给自动回收器

    可以参考Garbage Collection Programming Guide. (但文档不适用于iOS—IOS的你可以通过访问IOS开发中心获取该文档.)

原文:(http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ObjectiveC/Introduction/introObjectiveC.html#//apple_ref/doc/uid/TP30001163-CH1-SW2)

Introduction

The Objective-C language is a simple computer language designed to enable sophisticated object-oriented programming. Objective-C is defined as a small but powerful set of extensions to the standard ANSI C language. Its additions to C are mostly based on Smalltalk, one of the first object-oriented programming languages. Objective-C is designed to give C full object-oriented programming capabilities, and to do so in a simple and straightforward way.

Most object-oriented development environments consist of several parts:

  • An object-oriented programming language

  • A library of objects

  • A suite of development tools

  • A runtime environment

This document is about the first component of the development environment—the programming language. This document also provides a foundation for learning about the second component, the Objective-C applicationframeworks—collectively known as Cocoa. The runtime environment is described in a separate document,Objective-C Runtime Programming Guide.

Who Should Read This Document

The document is intended for readers who might be interested in:

  • Programming in Objective-C

  • Finding out about the basis for the Cocoa application frameworks

This document both introduces the object-oriented model that Objective-C is based upon and fully documents the language. It concentrates on the Objective-C extensions to C, not on the C language itself.

Because this isn’t a document about C, it assumes some prior acquaintance with that language. Object-oriented programming in Objective-C is, however, sufficiently different from procedural programming in ANSI C that you won’t be hampered if you’re not an experienced C programmer.

Organization of This Document

The following chapters cover all the features Objective-C adds to standard C.

  • “Objects, Classes, and Messaging”

  • “Defining a Class”

  • “Protocols”

  • “Declared Properties”

  • “Categories and Extensions”

  • “Associative References”

  • “Fast Enumeration”

  • “Enabling Static Behavior”

  • “Selectors”

  • “Exception Handling”

  • “Threading”

A glossary at the end of this document provides definitions of terms specific to Objective-C and object-oriented programming.

Conventions

This document makes special use of computer voice and italic fonts. Computer voice denotes words or characters that are to be taken literally (typed as they appear). Italic denotes words that represent something else or can be varied. For example, the syntax:

@interfaceClassName(CategoryName)

means that @interface and the two parentheses are required, but that you can choose the class name and category name.

Where example code is shown, ellipsis points indicates the parts, often substantial parts, that have been omitted:

- (void)encodeWithCoder:(NSCoder *)coder
{
    [super encodeWithCoder:coder];
    ...
}

See Also

If you have never used object-oriented programming to create applications, you should read Object-Oriented Programming with Objective-C. You should also consider reading it if you have used other object-oriented development environments such as C++ and Java because they have many expectations and conventions different from those of Objective-C. Object-Oriented Programming with Objective-C is designed to help you become familiar with object-oriented development from the perspective of an Objective-C developer. It spells out some of the implications of object-oriented design and gives you a flavor of what writing an object-oriented program is really like.

The Runtime System

Objective-C Runtime Programming Guide describes aspects of the Objective-C runtime and how you can use it.

Objective-C Runtime Reference describes the data structures and functions of the Objective-C runtime support library. Your programs can use these interfaces to interact with the Objective-C runtime system. For example, you can add classes or methods, or obtain a list of all class definitions for loaded classes.

Memory Management

Objective-C supports three mechanisms for memory management: automatic garbage collection and reference counting:

  • Automatic Reference Counting (ARC), where the compiler reasons about the lifetimes of objects.

  • Manual Reference Counting (MRC, sometimes referred to as MRR for “manual retain/release”), where you are ultimately responsible for determining the lifetime of objects.

    Manual reference counting is described in Advanced Memory Management Programming Guide.

  • Garbage collection, where you pass responsibility for determining the lifetime of objects to an automatic “collector.”

    Garbage collection is described in Garbage Collection Programming Guide. (Not available for iOS—you cannot access this document through the iOS Dev Center.)

Objective-C 编程语言官网文档(一)-简介相关推荐

  1. Objective-C 编程语言官网文档(二)-对象,类以及消息

    声明:本文档仅为个人学习过程中顺手翻译之作,方便开发的同胞借鉴参考.如有觉得译的不好不到位的地方,欢迎指正,将及时做出更正 尽量尊重原文档,因为首次Objective-C,有些地方可能直译了没有注意该 ...

  2. Objective-C 编程语言官网文档(四)-协议

    声明:本文档仅为个人学习过程中顺手翻译之作,方便开发的同胞借鉴参考.如有觉得译的不好不到位的地方,欢迎指正,将及时做出更正 尽量尊重原文档,因为首次Objective-C,有些地方可能直译了没有注意该 ...

  3. Go语言从入门到规范-1.1、Go语言官网文档大纲及环境搭建

    Go语言从入门到规范-1.1.Go语言官网文档大纲及环境搭建 文章目录 Go语言从入门到规范-1.1.Go语言官网文档大纲及环境搭建 前言 一.go简介及学习路径 二.安装go 1.下载Go发行版 2 ...

  4. redis过期机制(官网文档总结)

    官网地址:https://redis.io/commands/expire redis过期定义如下: Set a timeout on key. After the timeout has expir ...

  5. mybatis官网文档mybatis_doc

    在平时的学习中,我们可以去参考官网的文档来学习,这个文档有中文的,方便我们去阅读,而且这里的分类很详细. 官网文档链接:http://www.mybatis.org/mybatis-3/zh/inde ...

  6. vue-awesome-swiper官网文档

    vue-awesome-swiper官网文档 https://www.swiper.com.cn/api/index.html

  7. AFNetworking官网文档及翻译

    AFNetworking2.4.1解析 1.官网文档外加点中文注释 AFNetworking官网(点击进入) AFNetworking翻译注释 Architecture(结构) NSURLConnec ...

  8. SAP ME架构官网文档学习总结

    认证平台 SAP ME PAM(Platform Availability Matrix ) 安装的应用以及相应的数据库均可在官网上进行查看https://support.sap.com/pam 最低 ...

  9. 【VR】Leap Motion 官网文档 HandModel(手部模型)

    前言: 本系列译文是为迎合Unity VR的热潮与大家的学习需要,推出的针对Unity方向的Leap Motion官方文档中英对照翻译. 本篇为第六篇 <HandModel(手部模型)> ...

最新文章

  1. C#种死锁:事务(进程 ID 112)与另一个进程被死锁在 锁
  2. rust服务器假人文件,rust游戏手机版-rust手游预约(腐蚀游戏手机版)-乐游网安卓...
  3. python连接linux服务器读取txt文件_Python文件处理
  4. linux rmi端口,RMI 两个端口 - 差不多先生的个人空间 - OSCHINA - 中文开源技术交流社区...
  5. Effective C++学习第二天
  6. USACO-Section1.4 Mixing Milk (贪心算法)
  7. 开发部考核管理制度 随想
  8. 案例 体检套餐管理系统 需求一览 c# 1614099219
  9. MacBook设置终端命令行的颜色高亮显示
  10. “开发者的面试完全是无稽之谈”
  11. python模拟浏览器下载文件_python第一个脚本,模拟浏览器下载文件 | 学步园
  12. jsonp多次请求报错 not a function的解决方法
  13. 爱加密加固病毒分析-破解篇
  14. 作者序:互联网的负能量之声
  15. 美国服务器托管机房如何选择?
  16. gmx solvate命令
  17. Classic Shell给你的Win8/7装上更好用的开始菜单
  18. WINDOWS下输入法中英文切换
  19. EVE-NG打开Wireshark提示拒绝访问
  20. 正则表达式的使用(Javaphp),及常用表达式摘抄

热门文章

  1. 官方公布中国自行车排名十强辐轮王土拨鼠全世界碳纤维自行车品牌
  2. ubuntu 16.04 更改 ipv6、numa、thp、io scheduler
  3. 线性表顺序存储的一些操作(初始化,添加,删除)
  4. python strftime 中文 年 月 日
  5. multisim常用d触发器_请问这个符号的d触发器在multisim中的芯片代号是什么
  6. 大型欧姆龙PLC NJ系列ST语言Ethercat总线24轴 伺服电池生产线欧姆龙PLC程序大型程序NJ系列
  7. 如何设置和开始使用Synology NAS
  8. B-004 LC滤波器的基础知识
  9. ironpython 使用-IronPython
  10. 【百度地图API】你看过房产地图吗?你知道房产标注是如何建立的吗?