R.swift icon indicating copy to clipboard operation
R.swift copied to clipboard

R.nib 经常找不到文件

Open 18363853135 opened this issue 4 years ago • 5 comments

创建的UITableViewCell 或者image等文件, 经常无法.出来,前提 已经com+b com+r , 重启XCode和电脑 能解决一部分情况(文件路径正确),有时候只能删除本框架再重新pod才生效,此时时刻 又被这个问题困扰

18363853135 avatar Dec 15 '20 09:12 18363853135

Hi,

By auto translating your question I understand you're having trouble with code generation. For troubleshooting, please:

  • Ensure you followed the R.swift installation instructions from the README.
  • Ensure your XIB's and images are part of the correct Xcode build targets. You can see this by selecting the file(s) and looking at the sidebar on the right (under "target membership").
  • Note that for UITableViewCell XIBs without a reuse identifier, no code will be generated.

If that doesn't solve your problem, can you please provide a more detailed explanation of the issue you're running into?

mbernson avatar Dec 15 '20 12:12 mbernson

Hello

The file reference is correct. It is often encountered that the file cannot be found. There is no problem with the file pouring path. You can only restart Xcode or Mac every time, which can solve part of the situation. To completely solve the problem, you must remove r.swift and then pod install again. It is not limited to uitableview, but also uiview and uiimage, The framework is very convenient to use, but this situation is very painful. There are some developers who give up r.swift for these reasons. I hope you can give some guidance here

18363853135 avatar Dec 16 '20 03:12 18363853135

Just now, I encountered the problem that I couldn't find the file again,

The solution is to restart Xcode or Mac without modifying any code, but it is not valid every time

18363853135 avatar Dec 16 '20 03:12 18363853135

As now, In the morning, I encountered this problem and did not modify any code. Restart Xcode to solve this problem, Now I encounter it again. Restarting Xcode and restarting Mac can't solve the problem, except # pod 'R.swift' pod install I can't find a long-term solution or an effective way, as now,

18363853135 avatar Dec 16 '20 06:12 18363853135

when you drag R.generated.swift file to your target from $SRCROOT , you should ensure that the check

  • [ ] Copy items if needed is uncheck , then the file can be update when you build your project determinate

DukeHuang avatar Aug 09 '22 02:08 DukeHuang

Closing due to inactivity.

If this issue still persists, please reply with a method of reproducing your issue.

tomlokhorst avatar Nov 11 '22 22:11 tomlokhorst