Problem when copying image from project resources to documents folder in Objective-C?

I cant find any error in your code , I can only give one suggestion convert your image into NSData and write to document folder NSData *data;//data from you logo image data writeToFile: atomically:YES.

I'm not completely sure but I think your line: NSString *logoPath = webPath stringByAppendingPathComponent:@"logo"; should be: NSString *logoPath = webPath stringByAppendingPathComponent:@"logo. Png"; I think iOs does not recognize "logo" as "logo. Png".

It is, in order to make the code comprehensible, I renamed that part, and forgot of the extensions. – mikywan Mar 4 at 13:58.

Take a look at upperCase character in file name, sometimes errors come from that, iPhone is case sensitives, mac-simulator probably is not...

First of all, I would like to thank you all for your answers, all of them helped to resolve my issue. I'm not sure why, but when I copy a PNG image, somehow the image was corrupted, when I tried doing the same thing with a JPG image the problem was solved. Thanks!.

It turned out to be a problem with the file format. When I changed the image to a JPG, the problem was gone. It seems that apple changes PNG images, I'm not really sure about this, but for what I've experienced, it makes sence.

Thanks!

I'm having a really weird problem with the iPad app I'm writing. On startup I want to copy a folder containing a few other folders (that are empty) from the application bundle to the Documents directory. The folder to be copied, called 'flds' (all lowercase), was added to the Xcode 4 project using 'Create folder references for any added folders', and I have checked that it is actually part of the .

App file after compiling. Then copying using NSFileManager's copyItemAtPath:toPath:error: method (or the URL equivalent when using URL instead of path string). All of these strategies work perfectly in the iPad Simulator and on the iPad device, with the following exception: When I (successfully) build for Ad Hoc distribution, drag the .

App and the . Mobileprovision into iTunes, sync and then run the app on the device, the system no longer thinks the 'flds' folder exists! I've been trying to examine this for many hours, with no luck.

Again, I'm perfectly sure it works both in the simulator and on the device running from Xcode, but not when synced via iTunes. However, when I use this path to copy the folder to its new location in the Documents directory, only the folder itself and the . Txt file in it (which I put in there as a test, it's not really supposed to be there) gets copied, and not the 6-7 empty subfolders.

Again, the same pattern shows itself: Works as expected both on simulator and device running from Xcode ('flds' folder with 'test. Txt' and empty subfolders are copied successfully), but not when synced via iTunes (only 'flds' folder with 'test. Txt' are copied, not subfolders).

Is this really the intended behaviour of copyItemAtPath:toPath:error:? And why would it behave differently after syncing via iTunes?

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions