Adding an ObjC category with name matching an existing folder erroneously fails

Originator:lithium3141
Number:rdar://26487958 Date Originated:25-May-2016 11:30 PM
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode 7.3.1 (7D1014) / OS X 10.11.5 (15F34)
Classification:UI/Usability Reproducible:Always
 
Summary:
In Xcode 7, developers can add an Objective-C category to extend existing classes. When adding such a category, developers are prompted for both the name of the category and the class to be extended. The resulting file is named Class+CategoryName.[hm].

However, if a folder already exists with the given category name, the file add fails, claiming something named "CategoryName" already exists. This should be irrelevant, since the add dialog won't attempt to create anything named CategoryName.

Steps to Reproduce:
1. Create a new Xcode project from sample
2. In the project's source directory, create a folder named Extensions
3. In Xcode, add a new Objective-C category on any class named Extensions; save it in the source directory
4. Click Next

Expected Results:
The addition should succeed.

Actual Results:
The addition fails with error: '"Extensions" already exists. Do you want to replace it?'

Version:
Xcode 7.3.1 (7D1014) / OS X 10.11.5 (15F34)

Notes:
Download the attached sample project to cover steps 1 and 2 from above; open the project and continue from step 3.

Configuration:
Any Mac

Attachments:
'SomeArbitraryProject.zip' was successfully uploaded.

Comments

"SomeArbitraryProject.zip" is just the iOS single-view template project with an additional folder "Extensions" that contains only an empty file "some-arbitrary-file".

By lithium3141 at May 26, 2016, 6:32 a.m. (reply...)

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!