开发者

Get Bundle name from its executable

开发者 https://www.devze.com 2023-02-09 03:08 出处:网络
Given the path for a bund开发者_如何学Cle, how can I get the name of its executable? Example: blahblah.app

Given the path for a bund开发者_如何学Cle, how can I get the name of its executable?

Example:

blahblah.app

should give me

blahblah.app/Contents/MacOS/blahblah

Vice versa will also be okay


NSString *exe = [[NSBundle bundleWithPath:thePath] executablePath];

You can also use the URL variants if you're on Snow Leopard and want URLs instead.

0

精彩评论

暂无评论...
验证码 换一张
取 消