|
|
[XCode] Building with non-source files
|
|
|
|
Fresh-Faced Recruit
Join Date: Jul 2009
Status:
Offline
|
|
I'm new to Mac development (previously using vim + gcc on Linux), and I've been trying out XCode, but one of my projects I started to test it out requires a .ttf file at runtime to be in the same directory. I've tried adding the file as a resource, but it doesn't run. Could anybody: - Help me to get XCode to dump my file into the executable's directory or,
- Tell me where XCode puts the executable so I can dump it there myself
Thanks,
Jordy
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Oct 1999
Location: San Jose, Ca
Status:
Offline
|
|
Are you producing something that create a bundle? That would be almost everything but command-line programs. If so, then just adding it to the project and making sure that it is included in your target (done by default), then it will be in your <bundle>/Contents/Resources folder. And NSBundle has a number of methods to help you get a path to these resources (including ones for localized resources).
If you are not creating a bundle then you are going to need to go in and play with your Target. You can get to it under the "Targets" item in the "Groups & Files" pane in the main document window in XCode. You will have to add a new Build Phase item to copy this.
|
|
|
|
|
|
|
|
|
Fresh-Faced Recruit
Join Date: Jul 2009
Status:
Offline
|
|
Thanks. This fixed my problem.
I ended up using the second approach. My project doesn't use Cocoa or Carbon, so I imagine I wouldn't be able to access NSBundle.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|