Xcode should be able to automatically add #import and @import directives

Originator:kristopherdjohnson
Number:rdar://17948364 Date Originated:07-Aug-2014 02:40 PM
Status:Duplicate/11393314 Resolved:
Product:Developer Tools Product Version:Xcode 5 and Xcode 6 beta
Classification:Enhancement Reproducible:Not applicable
 
Summary:
While adding code to an Objective-C source file, one may use a class or function that is provided by the platform, a library, or another file in the project but which has not been declared in the current source file. To remedy this, the developer must scroll up to the top of the file, add a #include or @import line, then go back to wherever they were.

It would be helpful if Xcode would automatically suggest adding the necessary include/import directive when the developer types the name of a type or function that Xcode knows about but which is not already declared, and then automatically add it if the developer chooses to do so without moving the insertion point position.

Steps to Reproduce:
N/A

Expected Results:
N/A

Actual Results:
N/A

Version:
Xcode 5 and Xcode 6

Notes:
This feature is provided by IDEs for platforms (Eclipse, Visual Studio, etc.) and by AppCode for iOS/OS X development. It seems like it is "missing" from Xcode.

Configuration:
OS X 10.9

Attachments:

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!