开发者

Deleted file remains in NSBundle

开发者 https://www.devze.com 2023-04-08 20:22 出处:网络
I recently deleted a file within Xcode. After I deleted this file I cleaned up the project (Shift+cmd+K). For one or other reason the system shows the warning after the cleaning process has been finis

I recently deleted a file within Xcode. After I deleted this file I cleaned up the project (Shift+cmd+K). For one or other reason the system shows the warning after the cleaning process has been finished successfully:

no rule to process file '$(PROJECT_DIR)/json2.js' of type sourcecode.javascript for architecture i386

But this is not the deleted file since I deleted 1231345.jpg

I use the following code to开发者_开发问答 check if the path exists

if([[NSBundle mainBundle] pathForResource:@"1231345" ofType:@"jpg"] == NULL)
{
     //Here some code if the image doesn't exist
} else {
     //Here some code if the image does exist
}

If I manually change the 'pathForResource' to a random number which hasn't been a previous file everything works fine!

Whats going wrong here?


Have you deleted the app in the simulator/device? If you deploy via XCode, old files are not deleted, but if you build & archive and then install the archive it usually works.

0

精彩评论

暂无评论...
验证码 换一张
取 消