How to create custom “text macros” in Xcode?

How to create custom code completion macros in Xcode. I googled and find some methods, but I do not understand them completely. So can someone tell me how to do this?

Thanks to everyone ..

+2
source share
1 answer

In this post from the lesson there is a tutorial on adding custom text macros. The following are the necessary steps, as indicated in the tutorial, to create a custom text macro for Objective-C.

  • Xcode (root/Developer/Applications/). (Ctrl-) . (/PlugIns/TextMacros.xctxtmacro///). Objective-C.xctxtmarco (-c). Finder . ( ////Xcode/). Xcode Paste (command-v) Objective-C.xctxtmacro.

  • Objective-C.cxtxtmacro. 26 , Dictionary. "+" . plist, ( ).

  • . ( ), () (). , "+" . "" / .

  • "/" , , , :

    • - (). identifier.
    • BasedOn - () (objc).
    • IsMenuItem - . .
    • . ().
    • TextString - , ​​ .
    • CompletionPrefix. , .
  • . (: NSLog).

    • - objc. flog
    • BasedOn - objc
    • IsMenuItem -YES
    • - (NSLog)
    • TextString - NSLog (@ "FUNCTION:% s", _FUNCTION _);
    • CompletionPrefix - flog

    CompletionPrefix , . . flog, .

, .


: , v Xcode 3.2. , ,

OnlyAtBOL = YES; // or NO 

xctxtmacro. , , , .. . , flog .

{
    Identifier = objc.flog;
    BasedOn = objc;
    OnlyAtBOL = YES;
    IsMenuItem = YES;
    Name = "Function (NSLog)";
    TextString = "NSLog(@"FUNCTION: %s", _FUNCTION_)";
    CompletionPrefix = "flog";
}

, - .

+2

All Articles