解決下面狀況:app
1. 首先要用photoshop將png文件打開後另存爲png 文件,在彈出的交織與否時,選擇否。iphone
2. 還要看一下工程裏面的文件,有時多弄了幾個文件相同文件名時,記得去掉那些不用的,不然若只更換一處的話,仍是有錯誤。ui
應用在在模擬器上調試一點問題沒有,但一放到真機上調試就出現copypngfile 的錯誤,錯誤信息以下:google
CopyPNGFile /Users/gongihou/Library/Developer/Xcode/DerivedData/DLZ-frborfduejxrajgpkfdaipygijow/Build/Products/Debug-iphoneos/DLZ.app/zhuangtai.png DLZ/zhuangtai.pngspa
cd /Users/gongihou/Documents/910調試
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"code
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/copypng -compress "" /Users/gongihou/Documents/910/DLZ/zhuangtai.png /Users/gongihou/Library/Developer/Xcode/DerivedData/DLZ-frborfduejxrajgpkfdaipygijow/Build/Products/Debug-iphoneos/DLZ.app/zhuangtai.pngorm
Not a PNG filCommand /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/copypng emitted errors but did not return a nonzero exit code to indicate failure圖片
說是讀取的時候沒有找到這張圖片,檢查了一下圖片路徑,沒有問題,因而google之,找到兩種解決方法 :ip
1.在build settings裏把工程裏的Compress PNG files設置爲NO,問題解決,但這樣設置之後,弄出來的ipa會很大,感受不是很理想。
2.mac上的preview(預覽)打開出問題的png文件,而後從新導出爲png文件或者用photoshop把png圖片保存爲NOT INTERLACED(不交錯)的,這樣真機調試時就沒有錯誤了。