Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Darkroom

Guest
Original poster
Dec 15, 2006
2,445
0
Montréal, Canada
so in theApp.app's code it's possible to define the path of this app that is placed in a specific folder:

Code:
#define applicationPath @"/Applications/[I]theApp.app[/I]"

but this reference doesn't work if the user places theApp.app on the desktop, or in the downloads folder, etc... is there a way to define the path of an app using a wildcard or something?
 

Guiyon

macrumors 6502a
Mar 19, 2008
771
4
Cambridge, MA
Since you're working in Cocoa, your best bet would be to use:
Code:
NSString *applicationPath = [[NSBundle mainBundle] bundlePath]

IIRC, that should return the path to the main bundle of the currently executing application.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.