So in my normal apps, I package up the data folder by adding this to the Run Script dropdown:
cp -r bin/data "$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/Resources";
…and then adding the following code in the app somewhere early:
This has always worked for me, until my most recent application. This one uses a bunch of addons I haven’t used before, and also is my first app built within 009. Here’s what I’m noticing:
- Contents of the data folder are copied into the app’s
- Trying to load things from that data folder does not work.
- When I use a command to output the location of the data folder after I’ve set it, it tells me it has indeed changed to
../Resources/data/but does not give the full path.
system("pwd;");to see what folder we’re in, I see that OF is running out of the data folder (i.e. shell scripts run are being run out of
apps/myApps/emptyExample/bin/data. In other apps, I can see that they are being run out of
/bin/emptyExample.app/Contents/MacOSi.e. within the app bundle, I’m pretty sure)
- This occurs even if I put
main, or if I put it after
- If I make up a folder structure that is
../Resources/data/would put you), and put something in there and try to load it from the data folder, it loads fine
- I tried putting a
cdin the Run Scripts dropdown at the end, but it didn’t change anything
What’s going on here? What controls which folder everything is run out of? Any advice?
EDIT: Here are the addons I am using, and also the GLUT preferences (saw in another thread about “Use Current Working Directory” but it appears to already be disabled)