Mac OSX中的@executable_path, @load_path和@rpath的理解

时间:2016-08-11 17:36:43   收藏:0   阅读:1487

本文转载自:https://wincent.com/wiki/@executable_path,_@load_path_and_@rpath。个人觉得写的很不错,简洁明了。

Absolute paths

Useful for frameworks installed in shared locations. Example:

@executable_path

Useful for frameworks embedded inside applications, because it allows you to specify the location of the framework relative to the application‘s executable:

@loader_path

Available from Mac OS X 10.4 Tiger onwards; useful for frameworks embedded inside plug-ins, because it allows you to specify the location of the framework relative to the plug-in‘s code (remember, plug-ins may not actually know where they are going to be installed, relative to the application, so knowing @executable_path doesn‘t help us in this case):

Note that if the "loader" is an application rather than a plug-in, the @loader_path ends up being equivalent to @executable_path.

@rpath

New in Mac OS X 10.5 Leopard is @rpath. Key points:

Sources

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!