Example:

[[NSNotificationCenter defaultCenter] addObserver:self
                                         selector:@selector(handleStuff:)
                                             name:@"TestNotification" // Literal
                                           object:nil];

TextExpander Code:

Content: Plain Text: static NSString * const %clipboard = @"%clipboard";

Label: NSString Constant Replace

Abbreviation: ;snss

Steps:

  1. Delete the leading @" and trailing " from the string.

    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(handleStuff:)
                                                 name:TestNotification // Remove Literal
                                               object:nil];
    
  2. Copy the string to the clipboard.

  3. Move to the position in the file where you want to insert the constant declaration.

  4. Type ;snss and TextExpander will insert the constant:

    static NSString * const TestNotification = @"TestNotification";