Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does Xcode show errors in the source code, but does my app compile and run properly?

It shows the error, but when I build or compile the app. It works perfectly. There is no error in runtime. How can I solve this?

enter image description here

like image 996
Hem Poudyal Avatar asked Feb 17 '26 21:02

Hem Poudyal


1 Answers

These kinds of errors often occur if you have multiple targets (e.g. a "Test" target and an "App" target) and some files are linked with both targets and other files are linked with just the "App" target. So in order to fix this, browse through your files and make sure they are linked to the proper targets. Use the "target membership" pane to easily compare files in your project.

enter image description here

like image 94
Wolfgang Schreurs Avatar answered Feb 19 '26 11:02

Wolfgang Schreurs



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!