Skip to content

October 16, 2008

Save files on the iPhone Options

Are you trying to save files that sits on your desktop to the phone’s
file structure through xcode? If you are talking about ActiveSync kind
of file transfer, then the answer is no. The iPhone (if you didn’t
know yet) is a very close environment.

Now, that depends on why you want to do that. If you want to put a
file into the phone so your app can access it, then just put it along
with your app and you can reference it through NSBundle, like:

                NSString *imagePath = [[NSBundle mainBundle]
pathForResource:fileName ofType:@”png”];
                UIImage *image = [UIImage imageWithContentsOfFile:imagePath];

I’ve also put pre-built SQLite files along with the bundle so that app
can access them.

Sze Wong
Zerion Consulting
www.zerionconsulting.com

On Oct 1, 12:21 pm, “Lata Rastogi” <lethal.lo@gmail.com> wrote:

 

> Hi
> Can I save remote files on the iPhone using xcode?
> Thanks!
- Hide quoted text -
Read more from Software Development

Share your thoughts, post a comment.

(required)
(required)

Note: HTML is allowed. Your email address will never be published.

Subscribe to comments