Constants for Properties

 

Sometimes, you want to define constants for your properties (or ivars).  Accessorizer can generate the constants for you, and if you include the @interface <ClassName> in your selection when invoking the Accessorizer Action Panel service, Accessorizer will include the class for you.

Example: If I select the following properties and include the @interface declaration with the class name and invoke the Accessorizer Action Panel service (see Setup):

I can then launch the Action Menu or Action Panel and choose Constants for props or use assigned keyboard shortcut: “7”

I will get these results:

NSString *const kQVNeuralCenterKEYName = @"name";

NSString *const kQVNeuralCenterKEYObject = @"object";

NSString *const kQVNeuralCenterKEYFreq = @"freq";

NSString *const kQVNeuralCenterKEYFast = @"fast";

NSString *const kQVNeuralCenterKEYSongs = @"songs";



extern NSString *const kQVNeuralCenterKEYName;

extern NSString *const kQVNeuralCenterKEYObject;

extern NSString *const kQVNeuralCenterKEYFreq;

extern NSString *const kQVNeuralCenterKEYFast;

extern NSString *const kQVNeuralCenterKEYSongs;

If I select ONLY the properties (or ivars) without selecting the @interface <ClassName>, then I get place-holders.

Settings for how you want those constants to appear are in the Coding Style TAB, Formatting panel for Properties.