Tôi cũng bị lỗi này cắn. Câu trả lời đã được đưa ra ở đây là một trợ giúp tuyệt vời.
Tôi tìm thấy câu trả lời trong chủ đề này hữu ích khác nữa, nhưng tôi không chắc chắn nếu nó thực sự là một điều an toàn để làm (có vẻ như để tạo ra một AppID mới hoặc một cái gì đó):
iphone simulator resources not updating
Đây là những ghi chú cá nhân của tôi mà tôi đã thực hiện để giải quyết vấn đề này.
1) Open the project in Xcode
2) Right-click the folder reference (BLUE folder) in the navigator
at its root and pick "Remove Reference"
3) Close Xcode all the way
4a) Warning, this step might cause other problems in your project.
4b) Open the folder browser/Finder
4c) Navigate to: /users/USERNAME/Library/Application Support/
/iPhone Simulator/version/Applications/THISPROJFOLDER
4d) Delete this whole THISPROJFOLDER. The name of the folder may be all
numbers, but this clears the Xcode "Cache" so it will rebuild things
5) Find the actual folder where you store your pictures that were referenced,
and move the folder elsewhere and rename it.
6) Now open Xcode
7) In Xcode, select Product -> Clean. It should clean successfully.
8) Now run the program through Xcode. It should run, but (hopefully) crash or
otherwise fail because it doesn't detect the resource files you removed.
9) Now go standard Xcode usage and add the files back to the folder you want,
and add a reference to that folder in the Xcode navigator. Run the program
again, and it should detect the UPDATED PDFfiles/Imagefiles.
EDIT: Được rồi, tôi đi theo "câu trả lời" hướng dẫn từ bài Peter Hosey của trên, và làm việc quá. Có lẽ tốt hơn so với giải pháp của tôi ở đây, bởi vì bước 4 của tôi (bắt buộc) dường như để lấy lại một khóa ứng dụng hoặc một cái gì đó.
Vì vậy, đây là cách tôi cố định nó trong Xcode 4.0 sau bài Phêrô:
1) Open your project in Xcode
2) Select the main project root item in the Navigator
3) Select "Build Phases" in the main pane
4) Select "Add Build Phase" button -> "Add Run Script"
5) Reposition he "Run Script" entry bar in the screen,
and move it to just-before the Copy Bundle Resources area
6) Edit the run-script you just added in the main pane:
: Set Shell to: /bin/sh (its the default, or try /bin/tsch)
: Set the script line to: touch -cm ${SRCROOT}/MyDocs
(Set it to your folder root area, matching the Blue Folder
area in your Navigator)
7) Save it all and select "Product -> Clean" to clean project
Nguồn
2011-07-27 21:01:31
Cảm ơn thông tin đó. Tôi không thể tin rằng họ đã không giải quyết nó! Tôi thậm chí thấy rằng việc chạm vào các thư mục dường như không hoạt động, có lẽ vì có một số liên quan đến làm tổ. –
Michael Waterfall: Có; bạn cần chạm vào thư mục cụ thể mà bạn đã thêm vào dự án của mình. Chạm vào bất kỳ thứ gì trong đó, bao gồm bất kỳ thư mục con nào, sẽ không hoạt động (hoặc ít nhất nó không phải là lần cuối cùng tôi thử nó, một số thời gian trước đây). –
Tôi muốn thêm một cách giải quyết khác. Tôi cố gắng chọn cảm ứng như Peter Hosey nói, nhưng không giúp được gì. Những gì tôi đã làm là để sao chép các thư mục ra khỏi thư mục dự án, xóa và di chuyển vào thùng rác thư mục cũ, khởi động lại xcode và thêm thư mục sao chép các tập tin với các tùy chọn thư mục như bình thường. – Pacu