iOS 开发 深入浅出Runtime运行时之官方指南翻译--runtime介绍

官方指南结构图

runtime官方指南连接

这里写图片描述

Introduction

The Objective-C language defers as many decisions as it can from compile time and link time to runtime. Whenever possible, it does things dynamically. This means that the language requires not just a compiler, but also a runtime system to execute the compiled code. The runtime system acts as a kind of operating system for the Objective-C language; it’s what makes the language work.

This document looks at the NSObject class and how Objective-C programs interact with the runtime system. In particular, it examines the paradigms for dynamically loading new classes at runtime, and forwarding messages to other objects. It also provides information about how you can find information about objects while your program is running.

You should read this document to gain an understanding of how the Objective-C runtime system works and how you can take advantage of it. Typically, though, there should be little reason for you to need to know and understand this material to write a Cocoa application.

runtime介绍

objective - c语言尽可能把编译和链接的决定推迟到运行时处理。只要有可能,它就会动态地处理一些事情。这意味着objective - c语言需要的不仅仅是一个编译器,也需要一个运行时系统来执行编译后的代码。运行时系统作为objective - c语言的一种操作系统,这就是使objective - c语言动态的去工作。

本文着眼于NSObject类和objective - c程序如何与运行时系统交互。特别是,它检查在运行时动态加载新类的范例,并将消息转发给其他对象。它还提供了关于当您的程序正在运行时,如何找到信息对象的信息.

你应该阅读本文档了解objective - c运行时系统是如何工作的,以及如何利用它。一般来说,你应该没有理由需要知道和理解这种材料编写应用程序即可。

Organization of This Document

This document has the following chapters:

Runtime Versions and Platforms
Interacting with the Runtime
Messaging
Dynamic Method Resolution
Message Forwarding
Type Encodings
Declared Properties

本文的组织

本文有以下章节:

  • 运行时版本和平台
  • 与运行时交互
  • 消息传递
  • 动态方法处理
  • 消息转发
See Also

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.

Programming with Objective-C describes the Objective-C language.

Objective-C Release Notes describes some of the changes in the Objective-C runtime in recent releases of OS X.

另请参阅

objective - c运行时引用描述了数据结构和函数的objective - c运行时库的支持。你的程序可以使用这些接口与objective - c运行时系统交互。例如,您可以添加的类或方法,或获取加载类的所有类定义的列表。

objective - c描述了objective - c编程语言。

objective - c版本注释描述一些objective - c运行时的变化在最近版本的OS X。

由此我们就了解到了runtime运行时的用处

  1. OC与运行时交互.
  2. 消息发送(传递)机制.
  3. 动态方法处理机制.
  4. 消息转发机制.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值