什么是Objective-C中的NSBundle和mainBundle? [英] What is NSBundle and mainBundle in Objective-C?

查看:216
本文介绍了什么是Objective-C中的NSBundle和mainBundle?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于iOS应用程序上的Objective-C,我在Apple开发人员网站上阅读了一些示例程序,发现几乎所有应用程序都包含一个名为' NSBundle '' mainBundle ',我真的不理解这个词的意思。那是什么?

Regarding Objective-C on iOS application, I read some sample program in the Apple developer website and I found that almost all of the applications contains a word called 'NSBundle' and 'mainBundle', and I really don't understand the meaning of this word. What is that?

推荐答案

捆绑软件是用于在Mac OS X上打包软件的结构。应用程序,框架和插件是所有不同种类的捆绑包捆绑包可能包含可执行代码,资源,头文件和其他内容(包括其他捆绑包)。

A bundle is a structure used for packaging software on Mac OS X. Applications, frameworks and plug-ins are all different kinds of bundles. Bundles may contain executable code, resources, header files and other stuff (including other bundles) if you so wish.

捆绑包被实现为具有定义结构的目录树。应用程序,框架和插件在树的结构上各有不同。但是,对于Finder,捆绑包看起来像单个文件。

Bundles are implemented as directory trees with a defined structure. Applications, frameworks and plug-ins each have their own variation on the structure of the tree. However, to the Finder, bundles look like single files.

主捆绑包只是正在运行的应用程序的捆绑包。因此,例如,Apple邮件程序的主要捆绑包是/Applications/Mail.app。

The main bundle is simply the bundle of the application that is running. So, for instance, the main bundle of the Apple mail program is /Applications/Mail.app.

这篇关于什么是Objective-C中的NSBundle和mainBundle?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆