Package pycocoa :: Module runtime :: Class ObjCClass
[frames] | no frames]

Class ObjCClass

object --+    
         |    
  ObjCBase --+
             |
            ObjCClass

Python wrapper for an ObjC class.

Instance Methods
 
__getattr__(self, name)
Returns a callable method object with the given name.
 
__str__(self)
str(x)
 
add_protocol(self, protocol)
Add a protocol to this class.
 
get_classmethod(self, name)
Find a class method.
 
get_method(self, name)
Find an instance method.

Inherited from ObjCBase: __repr__

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Static Methods
a new object with type S, a subtype of T
__new__(cls, name_or_ptr, *protocols)
Create a new ObjCClass instance or return a previously created instance for the given ObjC class.
Properties
  name
  ptr
  NS

Inherited from object: __class__

Method Details

__new__(cls, name_or_ptr, *protocols)
Static Method

 

Create a new ObjCClass instance or return a previously created instance for the given ObjC class.

The argument is either the name of the class to retrieve or a pointer to the class.

Returns: a new object with type S, a subtype of T
Overrides: object.__new__

__str__(self)
(Informal representation operator)

 

str(x)

Overrides: object.__str__
(inherited documentation)

add_protocol(self, protocol)

 

Add a protocol to this class.

Parameters:
  • protocol - The protocol to add (str or Protocol_t).
Returns:
True if the protocol was added, False otherwise.

get_classmethod(self, name)

 

Find a class method.

Parameters:
  • name - Name of the method (str).
Returns:
The class method wrapper (ObjCClassMethod) or None.

get_method(self, name)

 

Find an instance method.

Parameters:
  • name - Name of the method (str).
Returns:
The instance method wrapper (ObjCMethod) or None.

Property Details

name

Get Method:
name(self)

ptr

Get Method:
ptr(self)

NS

Get Method:
ptr(self)