Re: How to get the file path to my application
Subject : Re: How to get the file path to my application
From: Preston Jackson <email@hidden >
Date: Wed, 30 Jul 2008 22:29:33 -0600
Delivered-to: email@hidden
Delivered-to: email@hidden
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:cc:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=HHILgNCQ5L283k19Z6HBenD4eOFwVCS+t4ESmxPQDxw=; b=ZJeIwi4pc04XFMurwnoHY3mymnK1KqrPuojXibr4x2polDrBmgeX0v7l4T182iDYfX kX+Uhg4DMJHlP/COWuQcif1s2PfOofCIvCJOztFcgFXgsiZyAKDwiLalZd7MXxDvj7LR eQ8zP7U9bStPml7Zjwx0Nxjti3KvRHSU8xDeo=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=cc:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=Aznn5/J6hcXdnM03tYlp7HwVLNouipsEpv/HkpLAbtVPSObTKvQpqbJXYF7ZoTFxIN 5ohPRSeoNPeCvWf5HUgctaRcVp0WUgF8sbS/HhiQM+rpdJCI91wuZvavhpLPb7DoDcRd 7DEIVCohPv64LuFKTR762uWyKeSmlpONinnHc=
In general, NSBundle is a good resource for this.
Try:
NSString* applicationPath = [[NSBundle mainBundle] bundlePath];
This will tell you the path of the application bundle (Fred.app) and
then you'll have to step up one element in the applicationPath to get
the parent directory.
Preston
On Jul 30, 2008, at 10:21 PM, Randy Canegaly wrote:
If I have a Cocoa application named Fred, how do programmatically
(in Fred's code) get the path to the directory where Fred.app is
stored?
Thanks
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden
This email sent to email@hidden
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.