Seeing resources from another app in same Xcode project

I have a Xcode project with two apps that have a separate MainMenu.nib file. Both are different apps with different source trees..

Why am I seeing resources in interface builder from one app in another?

I am a bit old school and using the AppDelegate rather than view controllers to capture events... but that should work fine

Thanks ahead of time.

Thanks for the post, this is something I don’t think I have seen before unless I have a reference to some of the file. Definitely a head scratcher for me. Inviting other developers here to to provide there opinion of possible causes for this.

One thought I have is that Xcode keeps a lot of build artifacts and project-related data in its derived data folder. This can often lead to stale or incorrect information being used by Interface Builder. Have you try to go to Product > Clean Build Folder (or Cmd+Shift+K). Do this for both projects/targets if they are in the same workspace.

Even if your NIB files are separate, the custom classes (e.g., your AppDelegate subclasses, custom NSWindowControllers, or NSView subclasses) that are referenced in those NIBs might be accidentally included in the wrong target. If a class from App A is somehow included in App B's target (or vice-versa), Interface Builder for App B's NIB might try to instantiate or show properties from App A's version of that class?

The Info.plist for each target specifies the main NIB file to load (NSMainNibFile). While this primarily affects runtime, an incorrect entry could potentially contribute to confusion if Xcode's internal indexing for IB is somehow using this as context. Select your project in the Project Navigator. Select each target in the targets list. Go to the Info tab. Look for Main nib file base name (or NSMainNibFile if viewing as source). Ensure it correctly points to its own MainMenu NIB.

Given your description, I'd put my money on a reference to the other project file as the most probable causes. Start with a clean/clear derived data, and then meticulously check target memberships. Maybe the project file should be checked and reviewed here.

Albert Pascual
  Worldwide Developer Relations.

You probably started both apps from the templates. Interface Builder is just XML, so classes are just class names. It doesn't know the difference between two different classes that are both named "ViewController".

I had this problem in a project I'm currently developing. My main app showed objects from my UI tester app. I closed the main app and opened just the subproject with the UI tester app. From there, I could safely refactor "ViewController" to "TestViewController" to fix the problem.

Nope.. just two apps, I checked the headers and there is no crossover.

I did copy and paste some items from the original project initially.. but I deleted those as the design matured. I think thats probably where the references are coming from.

I did a grep on the project directory and the references don't occur in the project file for the app... no clue.

I have cleaned the build, quit Xcode.. and they remain.

I can reproduce this 100%, you create an initial app add some stuff and refs to the app delegate.. then create another app in the same project and copy an past the items into the window

I don't have access to Radar, I suppose I could check bug reporter and follow up with that channel.

Thanks for the question, you can file a bug with Feedback Assistant.

Once you open the bug report, please post the FB number here for my reference.

If you have any questions about filing a bug report, take a look at Bug Reporting: How and Why?

Cheers,

Albert Pascual
  Worldwide Developer Relations.

FB21884054

Thanks for filing this, looks like still has the new fresh bug smell and has not being assigned to the correct team as well as the zip file you mentioned with the focused project isn't there. Make sure you upload that file, if you already have, let's give it sometime to show up.

You can see the status of your feedback in Feedback Assistant. There, you can track if the report is still being investigated, has a potential identifiable fix, or has been resolved in another way. The status appears beside the label "Resolution." We're unable to share any updates on specific reports on the forums.

For more details on when you'll see updates to your report, please see What to expect after submission.

Thanks for providing this, let's give the team sometime to review what you have sent.

Albert Pascual
  Worldwide Developer Relations.

Seeing resources from another app in same Xcode project
 
 
Q