XCode Macro Specification for DLog and ALog

Few weeks ago I read a great article on Prefix.pch and macros placed in that file to ease the debugging of cocoa apps. I tried using them and they turned out really useful. So I’ve decided to create text macros for them and share it with you - my 40 daily readers:

(
  {
    Identifier = objc.alog;
    BasedOn = objc;
    OnlyAtBOL = YES;
    IsMenuItem = YES;
    Name = "ALog(...)";
    TextString = "ALog(@"<#format#>", <#variables#>);";
    CompletionPrefix = "alog";
    InludeContexts = ("xcode.lang.objc.block");
  },
  {
    Identifier = objc.dlog;
    BasedOn = objc;
    OnlyAtBOL = YES;
    IsMenuItem = YES;
    Name = "DLog(...)";
    TextString = "DLog(@"<#format#>", <#variables#>);";
    CompletionPrefix = "dlog";
    InludeContexts = ("xcode.lang.objc.block");
  }
)

Recipe on how to consume this:

  1. Copy/paste it into local file.
  2. Name it ObjectiveC.xctxtmacro
  3. Place it in ~/Library/Application Support/Developer/Shared/Xcode/Specifications (create folders as needed)
  4. If you had XCode opened - restart it.
  5. Just type dlog or alog and hit [Tab] key to jump to first parameter - format string.
etc

Comments