2013-01-08 73 views
0

我需要得到应用(bundlePath或bundleURL)的路径,而不应用程序名称bundelPath没有应用程序的名称

NSUrl *strUrl = [[NSBundle mainBundle]bundleURL]; 

NSString *str = [[NSBundel mainBundel]bundlePath]; 

我如何去

回答

3

两个NSURLNSString有方法去除最后的路径组件,所以这应该给你你要找的东西:

NSURL *strUrl = [[[NSBundle mainBundle] bundleURL] URLByDeletingLastPathComponent]; 

NSString *str = [[[NSBundle mainBundle] bundlePath] stringByDeletingLastPathComponent]; 
相关问题