tags:

views:

488

answers:

3

As part of the development phase of my iPhone app it would be really useful to load a file from my local machine, i.e. not from the application bundle. Is that possible?

The purpose of this is so that I can build a version of our game, and then give it to one of our designers and they can edit a settings file locally on their machine and have the game reload it.

+3  A: 

I believe iPhone app can only access files from within it's own bundle. I don't think that you can upload separate file into a bundle.

However, you can access data over network, so maybe you can build in a module for development where you download the data file over network and your app will then initialize itself with that new data.

stefanB
+1  A: 

The simplest way is probably to set them up as a developer with xCode.
Have the file that they manipulate and then build and go each time they change something.

You will run into issues with your sandbox if you try and create a separate application. and you would have to create a web/ftp server on your phone to achieve this, which i am also guessing will be a lot of work. (there are plenty of file sharing apps out there)

another option is to use the simulator. you can have a bit more direct access with that.

it is one of the issues with developing for mobile devices.

Bluephlame
A: 

The approach I have generally used for this is a small web server. You can run a web server on the phone inside your program very easily using cocoahttpserver. Or you can run a web server on the desktop and connect to it using NSURLConnection. Using Bonjour over wireless, you can even have the devices discover each other (though this is a little more complicated than just typing in the IP address). It's generally easiest to run the web server on the desktop if possible, since the IP address changes less, and figuring out your phone's IP address is actually a little tricky if you want to do it in code without Bonjour.

Rob Napier