How to make XCode recognize a custom file extension as Objective-C for syntax highlighting? -
How to make XCode recognize a custom file extension as Objective-C for syntax highlighting? -
i'd xcode 4 recognize custom file extension (e.g. *.lx) objective-c syntax highlighting , indentation purposes. how tool automatically this?
xcode determines how represent file in user interface based on file's uniform type identifier. far know it's not possible add together additional file extension tags existing uti, can declare new uti conforms type want map to. scheme associate specified file extension(s) new uti , through conformance xcode , every other uti-aware application recognize files source code of mapped type.
you may want give thought declare new uti. example, if files of type beingness created tool bundle tool appropriate location. in absence of improve alternative can create stub application bundle , declare new uti there:
create new cocoa application project in xcode. in project settings, select application target, info tab. create new exported uti. set identifier field unique name using reverse dns notation domain control. example,com.yourdomain.objective-c-source
. set conforms field uti want map to, such public.objective-c-source
. can find browsing list of system-declared utis or exported in xcode's info.plist. set extensions field comma-separated list of extensions want associate new uti. commit alter lastly field pressing homecoming or moving focus different field. build , run application register launch services. restart xcode. xcode should utilize appropriate syntax highlighting files specified extension(s).
if doesn't work, check info.plist of built application ensure of expected info there without trailing whitespace. can check uti has been registered using lsregister
:
/system/library/frameworks/coreservices.framework/versions/a/frameworks/launchservices.framework/versions/a/support/lsregister -dump
search output uti's identifier , verify nowadays , active.
objective-c xcode
Comments
Post a Comment