Can I upload files from my computer to the iPhone app?
As part of the development phase of my iPhone application, it would be very helpful to download the file from my local machine, i.e. not from the application bundle. Is it possible?
The purpose of this is that I can build a version of our game and then give it to one of our designers and they can edit the settings file locally on their machine and reload the game.
a source to share
The easiest way is probably to install them as a developer using xCode.
Have a file that they manipulate and then build and go every time they change something.
You will run into problems with your sandbox when trying to create a standalone application. and you will need to create a web / ftp server on your phone for this, and I also think it will be a lot of work. (there are many file sharing apps out there)
another option is to use a simulator. you can have more direct access with this.
this is one of the challenges in mobile development.
a source to share
I believe the iPhone application can only access files from within its own package. I don't think you can upload a separate file to a package.
However, you can access the data over the network, so perhaps you can create a development module where you load the data file over the network and your application then initializes itself with this new data.
a source to share
The approach I usually use for this is a small web server. You can easily run a web server on your phone inside your program using cocoahttpserver . Or you can start a web server on your desktop and connect to it using NSURLConnection
. Using Bonjour wirelessly, you may even find that devices are discovering each other (although this is a little more complicated than just typing an IP address). It is generally easiest to start a web server on the desktop if possible, since the IP address changes less and figuring out your phone's IP is actually a little tricky if you want to do it in code without Bonjour.
a source to share