Xcode 5-DP appears to have hidden default header search path of $(SRCROOT)

Originator:chaos42
Number:rdar://14191879 Date Originated:18-Jun-2013 11:49 AM
Status:Open Resolved:
Product:Developer Tools Product Version:5.0 (5A11314m)
Classification:Serious Bug Reproducible:Always
 
Summary: Xcode 5-DP appears to have a hidden default header search path of $(SRCROOT). This can cause Xcode to #import incorrect header files if a subdirectory and root directory have headers with the same file name, even if the one in the root directory is not in the project. 

Steps to Reproduce:
1. Create a new Empty View application.
2. Create a custom NSObject class in a subfolder of your project called Foo. Make sure Foo.m is in your app target.
3. Copy the empty Foo.h/.m to the root folder of your project (where the AppDelegate, main.m etc are located). Do not add the copied empty Foo files to the project. Make sure to remove the ' copy' added to the file name.
3. Open the original Foo class file in Xcode and add a method, -(void)bar
4. In the ViewController.m, #import "Foo.h", in viewDidLoad, alloc/init a Foo, then call -bar.
5. Try to build.

Expected Results:
Project should build.

Actual Results:
Project fails to build because "no visible @inteface of Foo declares selector bar". Note that if you call performSelector:@selector(bar), you still get a warning about an undeclared selector, but bar will be called when run. 

Regression: Regression from Xcode 4.6

Notes: No workaround. Sample project attached.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!