Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 05-30-2009, 07:47 PM   #1 (permalink)
Registered Member
 
Join Date: Aug 2008
Location: London/Peterborough
Posts: 533
Default Copy folder structure from resources to Documents directory

Hi, I have a structure like this in my resources folder in xcode, all files are included in the project:

/resources/
----images
--------1.png
--------2.png
----data.xml
----blah.xml

I want to copy this in one whole chunk to the documents folder on the iphone, I can do each one individually by looking for it in the nsbundle.

Code:
NSString *file = [[NSBundle mainBundle] pathForResource:@"1" ofType:@"png"];

BOOL succeeded = [fileManager copyItemAtPath:file toPath:newpath1 error:&err];
I want to copy it as a whole here:

Code:
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
any ideas? or is it one at a time for me?
QuantumDoja is offline   Reply With Quote
Old 06-07-2010, 01:26 AM   #2 (permalink)
Registered Member
 
Join Date: Mar 2009
Location: Melbourne, Australia
Posts: 54
Default

Anyone?!
__________________
Easy Light - The simple, easy torch solution for the iPhone.
Track-a-tram - A dynamic tram timetable.
WeighIn - Track your daily calorie consumption as well as your daily weight.
greenflame is offline   Reply With Quote
Old 06-07-2010, 03:23 AM   #3 (permalink)
Senior Member
iPhone Dev SDK Supporter
 
Join Date: Jan 2010
Location: Issaquah, WA
Age: 41
Posts: 1,184
Default

That seems a little odd; what exactly are you trying to accomplish by copying all your resources from your bundle into your Documents folder?

Hopefully you at least realize that if you are using UIImage's imageNamed: method anywhere in your code, you will always be loading the image from your bundle, and not from the (potentially later updated) copy in your Documents folder.
__________________
Recall It! Tag your notes. Tag your photos. Tag your thoughts. Tag your life.

Recall It! for iPad

http://www.dljeffery.com
dljeffery is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Stats
Members: 158,471
Threads: 89,088
Posts: 380,120
Top Poster: BrianSlick (7,091)
Welcome to our newest member, cherubic
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 03:44 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0