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

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/kuangdacaikuang/article/details/53446675

官方指南结构图

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. 消息转发机制.

没有更多推荐了,返回首页

私密
私密原因:
请选择设置私密原因
  • 广告
  • 抄袭
  • 版权
  • 政治
  • 色情
  • 无意义
  • 其他
其他原因:
120
出错啦
系统繁忙,请稍后再试