Search code examples
objective-cimportheaderwildcardglob

Import files in objective-c using wildcard


Is it possible to import a glob of header files based on wildcard directives? I want to semantically do the following:

#import "*-(Extensions).h"

to import all files in my local directory that end with -(Extensions).h. How might I go about this? Thanks in advance for any help!


Solution

  • Nope.

    If you don't want to write a dozen import directives in multiple source files, you could write one header that imports all of your -(Extensions).h files, then import that into your source.

    You could generate said header automatically from a directory listing with a bit of shell scripting, then make that shell script a build phase in your Xcode project.