Alok Srivastava
Alok Srivastava

Reputation: 197

Xcode png image reference

I have made a project in xcode 3.2 after some time i upgraded my xcode in 4.2 every thing works fine. now i want to set up my project on another mac laptop having same environment. but during build it give me an error ie

CpResource ../../Desktop/th_text-field.png error: /Users/gchauhan/Documents/project backup/30july/lisnxios_lisnxios/Lisnx/../../Desktop/th_text-field.png: No such file or directory

while this th_text-field.png is not present in my xcode project. i don't how it is happening please some one way out of me from this problem. i will highly thankful

Upvotes: 1

Views: 2052

Answers (2)

hockeyman
hockeyman

Reputation: 1183

Thats normal. That image does not exist on other computer, so program can't find it. Always add images to your project bundle, so that it could work normally at other computers. I think even if you would add sandbox to your app it couldn't access image if he is in other directory, such as desktop or something like that. Music, Movies, Pictures and Downloads folders are easily accessable easy after sandboxing. To access other directories is alot of work to deal with sandbox. And you will need it if you are going to submit your app to appstore. And now, if that file doesnt shows up in xcode project's files list, then just add image (drag and drop) to your project files list and in window witch pops up, put tick on "Copy items...." and be sure that in "Add to targets" your app is ticked.

Upvotes: 1

Inder Kumar Rathore
Inder Kumar Rathore

Reputation: 39978

In you 3.2 project you must have added a referece of this png but not copied.
Remove reference and then add again now make sure copy item into destination ... is checked like below

enter image description here

Upvotes: 2

Related Questions