0

i need to get the path of the app (bundlePath or bundleURL) without the app name

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

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

how do i go about

Jaggu
  • 25
  • 5

1 Answers1

3

Both NSURL and NSString have methods to remove the last path component, so this should give what you are looking for:

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

NSString *str = [[[NSBundle mainBundle] bundlePath] stringByDeletingLastPathComponent];
Martin R
  • 529,903
  • 94
  • 1,240
  • 1,382