Load binary file on iPhone

Discussion of issues specific to mobile platforms such as iOS, Android, Symbian and Meego.
Post Reply
alxres
Gnoblar
Posts: 15
Joined: Wed Oct 29, 2008 2:42 pm

Load binary file on iPhone

Post by alxres »

Hi, I try to load binary file from the resources directory ,use this path Ogre::macBundlePath() + "/filename" but it's not work?
User avatar
masterfalcon
OGRE Team Member
OGRE Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126
Contact:

Re: Load binary file on iPhone

Post by masterfalcon »

We need more information. Is the path correct? Does the file exist? What problem are you seeing?
alxres
Gnoblar
Posts: 15
Joined: Wed Oct 29, 2008 2:42 pm

Re: Load binary file on iPhone

Post by alxres »

I put my binary file in resources folder( where is ogre.cfg and resources.cfg ) and try to load it, in debug mode macBundlePath() return "/var/mobile/Applications/device ID/Demo4.app", so I use this path macBundlePath() + "/"+filename ,in initOgre function use macBundlePath() + "/ogre.cfg" to load cfg file from same directory and its work.
User avatar
masterfalcon
OGRE Team Member
OGRE Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126
Contact:

Re: Load binary file on iPhone

Post by masterfalcon »

Are you copying it into the app bundle during a Copy Files build phase?
alxres
Gnoblar
Posts: 15
Joined: Wed Oct 29, 2008 2:42 pm

Re: Load binary file on iPhone

Post by alxres »

thanks , stupid mistake , i forgot to add it to project in XCode.
alxres
Gnoblar
Posts: 15
Joined: Wed Oct 29, 2008 2:42 pm

Re: Load binary file on iPhone

Post by alxres »

when I add some files in resource folder? how can i update it in XCode project? add a new copy files build phase ?
User avatar
masterfalcon
OGRE Team Member
OGRE Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126
Contact:

Re: Load binary file on iPhone

Post by masterfalcon »

Yup, that would do the trick and make sure that those files are included in the build phase.
User avatar
masterfalcon
OGRE Team Member
OGRE Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126
Contact:

Re: Load binary file on iPhone

Post by masterfalcon »

You've given us nothing to go on. Please supply more information, for example:

What is the error?
How are you trying to load the files? And how are you generating the path?
Is your project set up to copy the files into the app bundle?
If you're using the ResourceManager, are the resource locations being set up properly?
Post Reply