Inherits from NSObject
Declared in GBMethodArgument.h
GBMethodArgument.m

Overview

Defines a single method argument.

Tasks

Initialization & disposal

Argument data

Properties

argumentName

The name of the argument.

@property (readonly) NSString *argumentName

Discussion

Argument is part of method selector and defines -(result)arg:(type)var part of method.

Declared In

GBMethodArgument.h

argumentTypes

Array of argument types.

@property (readonly) NSArray *argumentTypes

Discussion

Types array define -(result)arg:(type)var part of method. If argument doesn't use types, this is empty array.

Declared In

GBMethodArgument.h

argumentVar

The name of the argument variable.

@property (copy) NSString *argumentVar

Discussion

Argument variable defines -(result)arg:(type)var part of method. If argument doesn't use variable, this is nil.

Declared In

GBMethodArgument.h

isTyped

Specifies whether the argument is typed or not. The argument is typed if it uses type and var.

@property (readonly) BOOL isTyped

Declared In

GBMethodArgument.h

isVariableArg

Specifies whether the argument is variable arg or not.

@property (assign) BOOL isVariableArg

Declared In

GBMethodArgument.h

terminationMacros

Array of variable arguments termination macros.

@property (readonly) NSArray *terminationMacros

Discussion

Termination macros array define -(result)arg:(type)var,...macros part of method. If argument isn't variable or doesn't have termination macros, this is nil.

Declared In

GBMethodArgument.h

Class Methods

methodArgumentWithName:

Returns autoreleased type-less method argument.

+ (id)methodArgumentWithName:(NSString *)name

Parameters

name
The name of the method argument, part of method selector.

Return Value

Returns initialized object or nil if initialization fails.

Discussion

Internally this sends allocated instance initWithName:types:var:terminationMacros: message, so check it's documentation for details.

Exceptions

NSException
Thrown if the argument is nil or empty string.

Declared In

GBMethodArgument.h

methodArgumentWithName:types:var:

Returns autoreleased method argument with the given parameters.

+ (id)methodArgumentWithName:(NSString *)name types:(NSArray *)types var:(NSString *)var

Parameters

name
The name of the method argument, part of method selector.
types
Array of argument types in the form of NSString instances or nil if not used.
var
Array of arguments in the form of GBMethodArgument instances or nil if not used.

Return Value

Returns initialized object or nil if initialization fails.

Discussion

Internally this sends allocated instance initWithName:types:var:terminationMacros: message, so check it's documentation for details.

Exceptions

NSException
Thrown if either of the given parameters is invalid.

Declared In

GBMethodArgument.h

methodArgumentWithName:types:var:terminationMacros:

Returns autoreleased method argument with the given parameters.

+ (id)methodArgumentWithName:(NSString *)name types:(NSArray *)types var:(NSString *)var terminationMacros:(NSArray *)macros

Parameters

name
The name of the method argument, part of method selector.
types
Array of argument types in the form of NSString instances or nil if not used.
var
Array of arguments in the form of GBMethodArgument instances or nil if not used.
macros
Array of variable arg termination macros or nil if not variable arg.

Return Value

Returns initialized object or nil if initialization fails.

Discussion

Internally this sends allocated instance initWithName:types:var:terminationMacros: message, so check it's documentation for details.

Exceptions

NSException
Thrown if either of the given parameters is invalid.

Declared In

GBMethodArgument.h

Instance Methods

initWithName:types:var:terminationMacros:

Initializes method argument with the given parameters.

- (id)initWithName:(NSString *)argument types:(NSArray *)types var:(NSString *)var terminationMacros:(NSArray *)macros

Parameters

argument
The name of the method argument, part of method selector.
types
Array of argument types in the form of NSString instances or nil if not used.
var
Array of arguments in the form of GBMethodArgument instances or nil if not used.
macros
Array of variable arg termination macros or nil if not variable arg.

Return Value

Returns initialized object or nil if initialization fails.

Discussion

This is the designated initializer. You can either use it to specify method argument with all parameters, in such case you must supply all parameters, or you can use it to specify method argument without type. In such case you should set types and var to nil. If the argument is variable arg type, you should pass in optional termination macros or empty array if no termination macro is used. To specify standard argument, pass nil for termination macros instead!

Note: If you use the selector for type-less argument, both initializer parameters - types and var must be nil. If only one of these is nil, exception is thrown.

Exceptions

NSException
Thrown if either of the given parameters is invalid.

Declared In

GBMethodArgument.h