Skip to content

Commit

Permalink
Add release and nil ivar macro. Change completion prefix for IBAction…
Browse files Browse the repository at this point in the history
… method macro to bring it in line with all other method macros. README edits.
  • Loading branch information
Marc Liyanage committed Feb 2, 2010
1 parent 4236b36 commit 253359e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 7 deletions.
16 changes: 13 additions & 3 deletions MyMacros.xctxtmacro
Expand Up @@ -93,6 +93,16 @@
CompletionPrefix = "@syni";
OnlyAtBOL = YES;
},
{
Identifier = objc.property.releasenil;
Name = "Release and nil ivar";
IsMenuItem = YES;
BasedOn = objc;
CompletionPrefix = rel;
OnlyAtBOL = YES;
TextString = "[<#!ivar!#> release];\n<#!ivar!#> = nil;\n";
IncludeContexts = ( xcode.lang.objc.implementation );
},

/* *********************************************************
* NSLog
Expand Down Expand Up @@ -217,7 +227,7 @@
IsMenuItem = YES;
BasedOn = objc.method;
Declaration = "- (IBAction)<#method name#>:(id)sender";
CompletionPrefix = iba;
CompletionPrefix = mei;
OnlyAtBOL = YES;
IncludeContexts = ( xcode.lang.objc.implementation );
},
Expand All @@ -226,7 +236,7 @@
Name = "Method Declaration - IBAction";
IsMenuItem = YES;
BasedOn = objc.method.ibaction;
CompletionPrefix = iba;
CompletionPrefix = mei;
TextString = "$(Declaration);";
OnlyAtBOL = YES;
IncludeContexts = ( xcode.lang.objcpp.interface, xcode.lang.objc.interface, xcode.lang.objcpp.protocol );
Expand Down Expand Up @@ -281,7 +291,7 @@
BasedOn = objc.method;
TextString = "<#description#>:(<#type#>)<#name#>";
CompletionPrefix = para;
OnlyAtBOL = YES;
OnlyAtBOL = NO;
IncludeContexts = ( xcode.lang.objc.implementation, xcode.lang.objcpp.interface, xcode.lang.objc.interface, xcode.lang.objcpp.protocol );
},

Expand Down
15 changes: 11 additions & 4 deletions README.md
Expand Up @@ -158,6 +158,7 @@ context, a definition will be inserted, and if you use the same prefix in an int
context, a declaration will be inserted.

Recommended shortcut for definition: ⌃M

Recommended shortcut for declaration: ⌃H

### Method Parameter
Expand All @@ -166,29 +167,35 @@ Inserts an `xxxx:(yyy)zzz` sequence to add a parameter to a method
definition/declaration. Ideal for combination with the method
blocks in the previous item.

Recommended shortcut: ⌃P
Recommended shortcut: Suggest to use the completion prefix.

Properties
----------

### Declarations

Inserts @property declarations. Cycles through three variants with
Inserts `@property` declarations. Cycles through three variants with
the `retain`, `assign` and `copy` attributes. The selection ends
up in the type and name part. Tip: copy/paste the property’s
instance variable declaration and paste it where you want the
declaration, select it and invoke the shortcut.

Recommended shortcut: ⌃R
Recommended shortcut: ⌃P

### Synthesize

Inserts @synthesize instructions. Cycles through two variants,
Inserts `@synthesize` instructions. Cycles through two variants,
the second of which uses the `property = ivar` form to assign the
property to an ivar with a different name.

Recommended shortcut: ⌃S

### Release and nil ivar

Inserts two lines to release and nil an ivar in a dealloc method.
The selection is used as ivar name.

Recommended shortcut: Recommend to use the completion prefix.

About the Cheat Sheet Generator
===============================
Expand Down

0 comments on commit 253359e

Please sign in to comment.