Samond Classes Library 1.2.6-STABLE build 219
List of all members
SCRuntimeMethod Class Reference

Representation of a class method. More...

#import <SCRuntimeMethod.h>

+ Inheritance diagram for SCRuntimeMethod:

Creating and Initializing Methods

(instancetype) + methodWithObjCMethod:
 
(instancetype) + methodWithClass:selector:
 
(instancetype) + methodWithClass:name:
 
(instancetype) + classMethodWithClass:selector:
 
(instancetype) + classMethodWithClass:name:
 
(instancetype) + methodWithSelector:implementation:signature:
 
(instancetype) - initWithObjCMethod:
 
(instancetype) - initWithClass:instance:selector:
 
(instancetype) - initWithClass:instance:name:
 
(instancetype) - initWithSelector:implementation:signature:
 

Quering Methods

SEL selector
 
NSString * name
 
IMP implementation
 
NSString * signature
 

Comparing Methods

(BOOL) - isEqualToMethod:
 
(BOOL) - isEqualToSelector:
 
(BOOL) - isEqualToName:
 
(BOOL) - isEqual:
 
(BOOL) - isEqualToObjCMethod:
 

Sending Messages

(void) - sendWithValue:target:arguments:
 
(void) - sendWithValue:target:
 
(id) - objectFromTarget:arguments:
 
(id) - objectFromTarget:
 
(void) - sendToTarget:arguments:
 
(void) - sendToTarget:
 

Communicating with Classes

(BOOL) - addToClass:instance:
 
(BOOL) - addToUnregisteredClass:instance:
 
(BOOL) - availableInClass:instance:
 
(BOOL) - availableInUnregisteredClass:instance:
 

Communicating with Protocols

(void) - addToProtocol:required:instance:
 
(BOOL) - availableInProtocol:required:instance:
 
(BOOL) - availableInProtocolWithName:required:instance:
 

Additional Inherited Members

- Instance Methods inherited from SCObject
(instancetype) - initWithCoder:
 
(instancetype) - initWithContentsOfSerializedFile:
 
(void) - encodeWithCoder:
 
(BOOL) - writeContentsToSerializedFile:
 
(instancetype) - initWithDataDictionary:
 
(instancetype) - initWithDataDictionaryFromFile:
 
(void) - writeToDataDictionary:
 
(void) - writeToDataDictionaryFile:atomically:
 
(void) - writeToDataDictionaryFile:
 
(NSDictionary *) - dataDictionary
 
(instancetype) - initWithStream:
 
(instancetype) - initWithFileStream:
 
(void) - writeToStream:
 
(void) - writeToFileStream:
 
(void) - appendToFileStream:
 
(id) - copyObject
 
(instancetype) - initWithData:
 
(instancetype) - initWithDataWrapper:
 
(instancetype) - initWithContentsOfFile:
 
(instancetype) - initWithContentsOfURL:
 
(instancetype) - initWithContentsOfURLString:
 
(void) - writeToData:
 
(BOOL) - writeToFile:
 
(BOOL) - writeToURL:
 
(BOOL) - writeToURLString:
 
(NSData *) - data
 
- Properties inherited from SCObject
NSString * className
 

Detailed Description

Representation of a class method.

SDK
macOS 10.6+, iOS 7.0+, GNUstep
Since
version 1.2.6

Provides access to runtime class methods:

Class instances can thrown the following exceptions:

Method Documentation

- (BOOL) addToClass: (Class)  class
instance: (BOOL)  instance 

Adds a receiving method to a given existing class.

Parameters
class- existing class
instance- YES for adding an instance method, NO for adding a class method
Returns
YES if a method was successfully added, otherwise NO
Exceptions
SCRuntimeException- runtime error detected
- (void) addToProtocol: (SCRuntimeUnregisteredProtocol *)  protocol
required: (BOOL)  required
instance: (BOOL)  instance 

Adds a receiving method to a given unregistered protocol.

Parameters
protocol- an unregistered protocol
required- YES for a required protocol method, NO for an optional protocol method
instance- YES for adding an instance method, NO for adding a class method
Exceptions
SCRuntimeException- runtime error detected
- (BOOL) addToUnregisteredClass: (SCRuntimeUnregisteredClass *)  class
instance: (BOOL)  instance 

Adds a receiving method to a given unregistered class.

Parameters
class- an unregistered class
instance- YES for adding an instance method, NO for adding a class method
Returns
YES if a method was successfully added, otherwise NO
Exceptions
SCRuntimeException- runtime error detected
- (BOOL) availableInClass: (Class)  class
instance: (BOOL)  instance 

Returns a boolean value that indicates whether a receiving method is present in a given class.

Parameters
class- an existing class
instance- YES for an instance method, NO for a class method
Returns
YES if a receving method is present in a given class, otherwise NO
- (BOOL) availableInProtocol: (SCRuntimeProtocol *)  protocol
required: (BOOL)  required
instance: (BOOL)  instance 

Returns a boolean value that indicates whether a receiving method is present in a given protocol.

Parameters
protocol- an existing protocol
required- YES for a required protocol method, NO for an optional protocol method
instance- YES for an instance method, NO for a class method
Returns
YES if a receving method is present in a given protocol, otherwise NO
- (BOOL) availableInProtocolWithName: (NSString *)  name
required: (BOOL)  required
instance: (BOOL)  instance 

Returns a boolean value that indicates whether a receiving method is present in a protocol with a given name.

Parameters
name- a protocol name
required- YES for a required protocol method, NO for an optional protocol method
instance- YES for an instance method, NO for a class method
Returns
YES if a receving method is present in a protocol with a given name, otherwise NO
- (BOOL) availableInUnregisteredClass: (SCRuntimeUnregisteredClass *)  class
instance: (BOOL)  instance 

Returns a boolean value that indicates whether a receiving method is present in a given unregistered class.

Parameters
class- an unregistered class
instance- YES for an instance method, NO for a class method
Returns
YES if a receving method is present in a given class, otherwise NO
+ (instancetype) classMethodWithClass: (Class)  class
name: (NSString *)  name 

Returns a class method created by using the specified class and method name.

Parameters
class- a class
name- a method name
Returns
A created method
Exceptions
SCRuntimeException- runtime error detected
+ (instancetype) classMethodWithClass: (Class)  class
selector: (SEL)  selector 

Returns a class method created by using the specified class and selector.

Parameters
class- a class
selector- a selector
Returns
A created method
Exceptions
SCRuntimeException- runtime error detected
- (instancetype) initWithClass: (Class)  class
instance: (BOOL)  instance
name: (NSString *)  name 

Initializes a method using the specified class, instance flag and method name.

Parameters
class- a class
instance- YES for instance method and NO for class method
name- a name
Returns
A newly initialized method
Exceptions
SCRuntimeException- runtime error detected
- (instancetype) initWithClass: (Class)  class
instance: (BOOL)  instance
selector: (SEL)  selector 

Initializes a method using the specified class, instance flag and selector.

Parameters
class- a class
instance- YES for instance method and NO for class method
selector- a selector
Returns
A newly initialized method
Exceptions
SCRuntimeException- runtime error detected
- (instancetype) initWithObjCMethod: (Method)  method

Initializes a method using a given pointer to existing runtime method.

Parameters
method- a pointer to runtime method
Returns
A newly initialized method
- (instancetype) initWithSelector: (SEL)  selector
implementation: (IMP)  implementation
signature: (NSString *)  signature 

Initializes a method using the specified selector, implementation and signature.

Parameters
selector- a method selector
implementation- a pointer to a method implementation
signature- a method signature
Returns
A newly initialized method
- (BOOL) isEqual: (id)  object

Returns a boolean value that indicates whether the receiving method is equals to a given object.

Parameters
object- an object with which to compare the receiving method
Returns
YES if a given object is equals to the receiving method, otherwise NO

Reimplemented from SCObject.

- (BOOL) isEqualToMethod: (SCRuntimeMethod *)  method

Returns a boolean value that indicates whether the receiving method is equals to an another given method.

Parameters
method- the method with which to compare the receiving method
Returns
YES if the other method is equals to the receiving method, otherwise NO
- (BOOL) isEqualToName: (NSString *)  name

Returns a boolean value that indicates whether the receiving method is equals to a method with a given name.

Parameters
name- a name of method with which to compare the receiving method
Returns
YES if the method with a given name is equals to the receiving method, otherwise NO
- (BOOL) isEqualToObjCMethod: (Method)  method

Returns a boolean value that indicates whether the receiving method is equals to a pointer to runtime method.

Parameters
method- a pointer to runtime method with which to compare the receiving method
Returns
YES if a method with a given runtime pointer is equals to the receiving method, otherwise NO
- (BOOL) isEqualToSelector: (SEL)  selector

Returns a boolean value that indicates whether the receiving method is equals to a method with a given selector.

Parameters
selector- a selector of method with which to compare the receiving method
Returns
YES if the method of a given selector is equals to the receiving method, otherwise NO
+ (instancetype) methodWithClass: (Class)  class
name: (NSString *)  name 

Returns an instance method created by using the specified class and method name.

Parameters
class- a class
name- a method name
Returns
A created method
Exceptions
SCRuntimeException- runtime error detected
+ (instancetype) methodWithClass: (Class)  class
selector: (SEL)  selector 

Returns an instance method created by using the specified class and selector.

Parameters
class- a class
selector- a selector
Returns
A created method
Exceptions
SCRuntimeException- runtime error detected
+ (instancetype) methodWithObjCMethod: (Method)  method

Returns a method created by using a given pointer to existing runtime method.

Parameters
method- a pointer to runtime method
Returns
A created method
+ (instancetype) methodWithSelector: (SEL)  selector
implementation: (IMP)  implementation
signature: (NSString *)  signature 

Returns a method created by using the specified selector, implementation and signature.

Parameters
selector- a method selector
implementation- a pointer to a method implementation
signature- a method signature
Returns
A created method
- (id) objectFromTarget: (id)  target
,   ... 

Sends a message and returns an object using a given message receiver and comma-separated list of arguments.

Parameters
target- a message receiver (class instance or class object)
...- a comma-separated list of method arguments (for each argument, You must use a macros SC_ARG)
Returns
An object from a method
Exceptions
SCRuntimeException- runtime error detected
- (id) objectFromTarget: (id)  target
arguments: (va_list)  arguments 

Sends a message and returns an object using a given message receiver and list of arguments.

Parameters
target- a message receiver (class instance or class object)
arguments- a list of method arguments
Returns
An object from a method
Exceptions
SCRuntimeException- runtime error detected
- (void) sendToTarget: (id)  target
,   ... 

Sends a message using a given message receiver and comma-separated list of arguments.

Parameters
target- a message receiver (class instance or class object)
...- a comma-separated list of method arguments (for each argument, You must use a macros SC_ARG)
Exceptions
SCRuntimeException- runtime error detected
- (void) sendToTarget: (id)  target
arguments: (va_list)  arguments 

Sends a message using a given message receiver and list of arguments.

Parameters
target- a message receiver (class instance or class object)
arguments- a list of method arguments
Exceptions
SCRuntimeException- runtime error detected
- (void) sendWithValue: (void *)  value
target: (id)  target
,   ... 

Sends a message using a given buffer for a returning value, message receiver and comma-separated list of arguments.

Parameters
value- a pointer to a buffer for returning value
target- a message receiver (class instance or class object)
...- a comma-separated list of method arguments (for each argument, You must use a macros SC_ARG)
Exceptions
SCRuntimeException- runtime error detected
- (void) sendWithValue: (void *)  value
target: (id)  target
arguments: (va_list)  arguments 

Sends a message using a given buffer for a returning value, message receiver and list of arguments.

Parameters
value- a pointer to a buffer for returning value
target- a message receiver (class instance or class object)
arguments- a list of method arguments
Exceptions
SCRuntimeException- runtime error detected

Property Documentation

- (IMP) implementation
readwritenonatomicassign

A pointer to a method implementation

- (NSString *) name
readnonatomicretain

A method name

- (SEL) selector
readnonatomicassign

A method selector

- (NSString *) signature
readnonatomiccopy

A method signature


The documentation for this class was generated from the following files: