Tuesday, 15 July 2014

ios - Is it possible to sort files in compile sources of Build Phases section in Xcode? -



ios - Is it possible to sort files in compile sources of Build Phases section in Xcode? -

i want list classes in 'compile sources' section of xcode sorted according class name. possible?

yes, can reorder compile sources section in xcode, not gui - shame considering version 6 of ide , still haven't gotten around basic feature.

as a-live said, need edit project.pbxproj file within yourproject.xcodeproj file. utilize finder select yourproject.xcodeproj file , utilize context menu show bundle contents. after open project.pbxproj file text editor.

find pbxsourcesbuildphase section , re-create between files = ( , ); new text file. remove leading tabs/spaces. save file somewhere on disk. open terminal , this:

sort -bf -t " " -k 3 pbxsourcesbuildphase.txt > pbxsourcesbuildphase.sorted.txt

open new pbxsourcesbuildphase.sorted.txt file in text editor, re-create sorted lines pbxsourcesbuildphase section of project.pbxproj (overwrite lines copied) , save.

now should able see files sorted in compile sources section in xcode.

i've tested in xcode 6.0.1 little project (~150 source files) , had no problems.

careful: should create backup of project file (or better: utilize version control) before seek this. in case.

ios xcode5

No comments:

Post a Comment