`

【翻译】(objc-1)介绍

 
阅读更多

【翻译】(objc-1)介绍

 

see

https://developer.apple.com/library/mac/#documentation/cocoa/conceptual/objectivec/Introduction/introObjectiveC.html

 

原文见

https://developer.apple.com/library/mac/#documentation/cocoa/conceptual/objectivec/Introduction/introObjectiveC.html

 

--------------------------------------------

 

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.

 

Objective-C语言是一种简单的计算机语言,它被设计以使能复杂的面向对象编程。Objective-C被设计为标准ANSI C语言(注:ANSI是American National Standards Institute,美国国家标准学会的缩写。ANSI C是C语言使用最广泛的一个版本)的一种小型但强大的扩展集合。它对C的附加大多数基于Smalltalk,第一个面向对象编程语言之一(注:维基上说它是第二个,第一个应该是Simula)。Objective-C被设计为赋予C完全面向对象编程能力,以及设计为用一种简单和直接的方式做到这一点。

 

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 application frameworks—collectively known as Cocoa. The runtime environment is described in a separate document, Objective-C Runtime Programming Guide.

 

本文档是关于开发环境的第一个组件——编程语言。本文档还提供一个学习第二组件的基础,Objective-C应用程序框架——总称为Cocoa。运行时环境在一个单独的文档中描述,Objective-C运行时编程指南。

 

--------------------------------------------

 

Who Should Read This Document

 

谁应该阅读本文档

 

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

 

该文档是打算给那些可能兴趣于以下内容的读者看:

 

* Programming in Objective-C

 

* 用Objective-C编程

 

* Finding out about the basis for the Cocoa application frameworks

 

* 认识Cocoa应用程序框架的基础

 

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.

 

本文既介绍Objective-C所基于的面向对象模型,还完全地文档化该语言。它专注于Objective-C对C的扩展,而非C语言本身。

 

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.

 

因为这不是关于C的文档,它假设了那种语言的一些预备知识。然而,在Objective-C中面向对象编程和ANSI C中的过程式编程非常地不同,所以如果你不是一个有经验的C程序员你也不会被妨碍。

 

--------------------------------------------

 

Organization of This Document

 

本文档的组织结构

 

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

 

以下章节涵盖Objective-C添加到标准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.

 

本文档最后的术语表提供特定于Objective-C和面向对象编程的术语定义。

 

--------------------------------------------

 

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)

 

@interface 类名(分类名)

 

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

 

意思是@interface和两个括号是必需的,但你可以选择类名和分类名。

 

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.

 

如果你还没有使用过面向对象编程来创建应用程序,那么你应该阅读《Objective-C面向对象编程》。你还应该考虑阅读它如果你曾经使用过其它面向对象开发环境诸如C++和Java,因为它们由很多不同于Objective-C的期望和约定。《Objective-C面向对象编程》被设计为帮助你从Objective-C开发者的角度来熟悉面向对象开发。它讲解一些面向对象设计的内涵并且带给你对编写一个面向对象程序实际上像什么的感觉。

 

The Runtime System

 

运行时系统

 

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

 

Objective-C运行时编程指南描述Objective-C运行时的各个方面以及你可以如何使用它。

 

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.

 

Objective-C运行时参考描述Objective-C运行时支持库的数据结构和函数。你的程序可以使用这些接口与Objective-C运行时系统交互。例如,你可以添加类或方法,或者获得被加载类的所有类定义的列表。

 

Memory Management

 

内存管理

 

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

 

Objective-C支持内存管理,自动垃圾回收和引用计数,的三种机制:

 

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

 

* 自动引用计数(ARC),在这里编译器推测对象的生命周期。

 

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

 

* 手动引用计数(MRC,有时被称为MRR,表示“手动保持/释放”),在这里你最终负责决定对象的生命周期。

 

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.)

 

垃圾回收在垃圾回收编程指南中被描述。(对于iOS来说它是不可用的——你无法通过iOS开发中心访问到这个文档。)

 

--------------------------------------------

 

(c) 2011 Apple Inc. All Rights Reserved. (Last updated: 2011-10-12)

 

Apple公司版权所有。(最后更新:2011-10-12)

 

(本人翻译欠佳,请以官方文档为准。或者参考:

* 基于Objective-C的面向对象编程(官方中文文档)

http://www.apple.com.cn/developer/mac/library/documentation/Cocoa/Conceptual/OOP_ObjC/Introduction/chapter_1_section_1.html


分享到:
评论

相关推荐

    j2objc-annotations-1.3-API文档-中文版.zip

    包含翻译后的API文档:j2objc-annotations-1.3-javadoc-API文档-中文(简体)版.zip; Maven坐标:com.google.j2objc:j2objc-annotations:1.3; 标签:google、j2objc、annotations、中文文档、jar包、java; 使用方法...

    j2objc-annotations-1.1-API文档-中文版.zip

    包含翻译后的API文档:j2objc-annotations-1.1-javadoc-API文档-中文(简体)版.zip; Maven坐标:com.google.j2objc:j2objc-annotations:1.1; 标签:j2objc、annotations、google、jar包、java、中文文档; 使用方法...

    j2objc-annotations-1.1-API文档-中英对照版.zip

    包含翻译后的API文档:j2objc-annotations-1.1-javadoc-API文档-中文(简体)-英语-对照版.zip; Maven坐标:com.google.j2objc:j2objc-annotations:1.1; 标签:j2objc、annotations、google、jar包、java、中英对照...

    objc-msg-arm64.s

    objc-msg-arm64.s源文件,objc-msg-arm64.s源文件,objc-msg-arm64.s源文件,objc-msg-arm64.s源文件,objc-msg-arm64.s源文件,objc-msg-arm64.s源文件,objc-msg-arm64.s源文件,objc-msg-arm64.s源文件,objc-msg...

    j2objc-annotations-2.8.jar

    javaweb/javaee 常用jar包,亲测可用,若需其他版本其他jar包请留言我看到后会上传分享

    j2objc-annotations-1.3.jar

    java运行依赖jar包

    j2objc-annotations-1.3.jar中文-英文对照文档.zip

    (1)为了防止解压后路径太长导致浏览器无法打开,推荐在解压时选择“解压到当前文件夹”(放心,自带文件夹,文件不会散落一地); (2)有时,一套Java组件会有多个jar,所以在下载前,请仔细阅读本篇描述,以...

    j2objc-annotations-1.1.jar

    The type com.google.j2objc.annotations.ReflectionSupport$Level cannot be resolved. It is indirectly referenced from required .class files

    wxh gcc-objc-3.4.5-20060117-1-src

    标题中的“wxh gcc-objc-3.4.5-20060117-1-src”指的是一个特定版本的GCC(GNU Compiler Collection)源代码包,用于Objective-C编程语言。GCC是世界上最广泛使用的开源编译器,它不仅支持C、C++,还支持Objective-C...

    gcc-objc-4.1.2-46.el5.i386.rpm

    gcc直接编译objective-c,需要两个包libobjc-4.1.2-46.el5 和 gcc-objc-4.1.2-46.el5。

    gcc-objc-4.5.1.tar.bz2

    gcc-objc-4.5.1.tar.bz2

    gcc-objc-3.4.6-3.i386.rpm

    gcc-objc-3.4.6-3.i386.rpm

    j2objc-0.5.6.zip_J2ObjC_j2objc-0.5.6

    1. **安装与配置**:首先,需要下载J2ObjC的压缩包,例如本例中的j2objc-0.5.6.zip,解压后将其添加到系统的PATH环境变量中,以便在命令行中调用。 2. **转换Java代码**:通过命令行工具执行`j2objc`命令,指定待...

    gcc-objc-3.4.5-20060117-3.tar.gz

    标题中的"gcc-objc-3.4.5-20060117-3.tar.gz"是一个GCC(GNU Compiler Collection)Objective-C版本的压缩包文件,版本号为3.4.5,发布日期为2006年1月17日。GCC是一个开源的编译器集合,支持多种编程语言,包括C、...

    gcc-objc-3.4.6-10.i386.rpm

    gcc-objc-3.4.6-10.i386.rpm

    OBJC-APP-Arch.pdf

    1. OBJC-APP-Arch.pdf文件是Ray Wenderlich图书系列中《app-architecture》的PDF版本。Ray Wenderlich是一个知名的在线教育平台,专注于提供游戏开发、编程语言和应用开发的教程和资源。《app-architecture》作为该...

    gcc-objc-4.8.5-36.el7.x86_64.rpm

    gcc-objc-4.8.5-36.el7.x86_64.rpm

    j2objc-annotations-1.3-API文档-中英对照版.zip

    包含翻译后的API文档:j2objc-annotations-1.3-javadoc-API文档-中文(简体)-英语-对照版.zip; Maven坐标:com.google.j2objc:j2objc-annotations:1.3; 标签:j2objc、annotations、google、jar包、java、中英对照...

    objc-TimesSquare-master_for_iOS567_new

    标题"objc-TimesSquare-master_for_iOS567_new"表明这是一个经过优化的版本,特别针对iOS 5、6、7这三个旧版本系统进行了兼容性处理,使得开发者可以在这些较老的设备上使用TimesSquare控件。 TimesSquare的原版...

    Chart.js 包装 Chart.js-ObjC-Wrapper.zip

    Chart.js 包装 Chart.js-ObjC-Wrapper ,Chart.js-ObjC-Wrapper 可与 WKWebView/WebView 结合,将 Ch...

Global site tag (gtag.js) - Google Analytics