How to use the clang -rewrite-objc
command View c ++ source code?
Because direct use -rewrite-objc xxx.m abnormality is generated, if you want to use the normal use of instructions for:
//原始指令
clang -x objective-c -rewrite-objc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk xxxxx.m
Of course, you can also be defined by the Alias shortcut commands, as follows:
1, enter the terminal, type the command
vim ~/.bash_profile
2, the input interface vim i edit mode and the edit type:
`Alias rewriteoc = 'Clang the -X--rewrite Objective-C-ObjC -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/ SDKs / iPhoneSimulator.sdk '3, finish typing, point esc to exit edit mode, then type: wq save and quit vim, execution Source ~ / .bash_profile <- sentence must be executed, execution will not take effect
The next project can go to the main path of execution: rewriteoc main.m you can see the effect;