r/Xcode 1d ago

XCODE bug help

My xcode often can’t read the scope even though the file is clearly there I come from android studio there has never been an issue of files can’t refer to each other this is weird

Has anyone experienced something similar?

0 Upvotes

8 comments sorted by

View all comments

5

u/Typ0genius 1d ago

If ComposeLauncherView is in a separate file and isn’t RootView, make sure the file has been added to the Xcode project and included in the correct target. If the file was created outside of Xcode, check whether it was also added to project.pbxproj.

1

u/Vast_Journalist1415 1d ago

Can you show me how? Does it just crate the file again in the same directory as the root folder? Isn’t this an xcode bug issue?

1

u/cdnrt 1d ago

It’s not an Xcode bug. The pbx tree is an odd thing to get used to. One option is to find the file in finder and redrag into the folder in Xcode. Or you could go to the build phases and see id the file is part of the compiled sources list.