customizing getter body template

Hi

I can't find any docs for how to customize templates.

I have this template for "OC Property Getter Body":
return $IVAR;

How do I turn this into a template that produces the following output (a lazy initialization getter):

- (NSMutableArray *)buttons {
    if (!buttons) {
        buttons = [[NSMutableArray alloc] init];
    }
    return buttons;
}


Is there a documentation for code variables one can use in templates? The problem above is that I don't seem to have access to the return type which I need for the alloc method...
2 comments
Comment actions Permalink

Hmm... I guess not too many people ever edit their templates? Nobody knows? Is there documentation somewhere?

0
Comment actions Permalink

We don't have documentation yet, but will add it in the next version (http://youtrack.jetbrains.com/issue/OC-5404).
To get the idea about available template variables, see the other templates.

Unfortunatelly, there is no template variable to denote the receiver class to perform the initialization, please file a request.

0

Please sign in to leave a comment.