Documentation
¶
Overview ¶
Package objectivec provides Go bindings for the ObjectiveC framework.
Gain low-level access to the Objective-C runtime and the Objective-C root types.
The Objective-C Runtime module APIs define the base of the Objective-C language. These APIs include:
Classes ¶
- NSObject: The root class of most Objective-C class hierarchies, from which subclasses inherit a basic interface to the runtime system and the ability to behave as Objective-C objects.
Protocols ¶
- NSObject: The group of methods that are fundamental to all Objective-C objects.
Key Types ¶
Code generated from Apple documentation. DO NOT EDIT.
Index ¶
- func BindFunc(fptr any, name string) (err error)
- func ClassSliceToNSArray(slice []objc.Class) objc.ID
- func Class_addIvar(cls objc.Class, name string, size uintptr, alignment uint8, types string) bool
- func Class_addMethod(cls objc.Class, name SEL, imp IMP, types string) bool
- func Class_addProperty(cls objc.Class, name string, attributes *Objc_property_attribute_t, ...) bool
- func Class_addProtocol(cls objc.Class, protocol_ *Protocol) bool
- func Class_conformsToProtocol(cls objc.Class, protocol_ *Protocol) bool
- func Class_getImageName(cls objc.Class) *byte
- func Class_getInstanceSize(cls objc.Class) uintptr
- func Class_getIvarLayout(cls objc.Class) *uint8
- func Class_getName(cls objc.Class) *byte
- func Class_getProperty(cls objc.Class, name string) unsafe.Pointer
- func Class_getSuperclass(cls objc.Class) objc.Class
- func Class_getVersion(cls objc.Class) int32
- func Class_getWeakIvarLayout(cls objc.Class) *uint8
- func Class_isMetaClass(cls objc.Class) bool
- func Class_replaceProperty(cls objc.Class, name string, attributes *Objc_property_attribute_t, ...)
- func Class_respondsToSelector(cls objc.Class, sel SEL) bool
- func Class_setIvarLayout(cls objc.Class, layout []byte)
- func Class_setVersion(cls objc.Class, version int32)
- func Class_setWeakIvarLayout(cls objc.Class, layout []byte)
- func IDSliceToNSArray(slice []objc.ID) objc.ID
- func IObjectSliceToNSArray[T IObject](slice []T) objc.ID
- func Imp_removeBlock(anImp IMP) bool
- func Ivar_getName(v Ivar) *byte
- func Ivar_getOffset(v Ivar) int
- func Ivar_getTypeEncoding(v Ivar) *byte
- func Method_copyArgumentType(m Method, index uint32) *byte
- func Method_copyReturnType(m Method) *byte
- func Method_exchangeImplementations(m1 Method, m2 Method)
- func Method_getArgumentType(m Method, index uint32, dst *byte, dst_len uintptr)
- func Method_getNumberOfArguments(m Method) uint32
- func Method_getReturnType(m Method, dst *byte, dst_len uintptr)
- func Method_getTypeEncoding(m Method) *byte
- func Method_invoke()
- func NXCompareHashTables(table1 *NXHashTable, table2 *NXHashTable) booldeprecated
- func NXCountHashTable(table *NXHashTable) uint32deprecated
- func NXEmptyHashTable(table *NXHashTable)deprecated
- func NXFreeHashTable(table *NXHashTable)deprecated
- func NXHashGet(table *NXHashTable, data unsafe.Pointer) unsafe.Pointerdeprecated
- func NXHashInsert(table *NXHashTable, data unsafe.Pointer) unsafe.Pointerdeprecated
- func NXHashInsertIfAbsent(table *NXHashTable, data unsafe.Pointer) unsafe.Pointerdeprecated
- func NXHashMember(table *NXHashTable, data unsafe.Pointer) int32deprecated
- func NXHashRemove(table *NXHashTable, data unsafe.Pointer) unsafe.Pointerdeprecated
- func NXNextHashState(table *NXHashTable, state *NXHashState, data unsafe.Pointer) int32deprecated
- func NXNoEffectFree(info unsafe.Pointer, data unsafe.Pointer)deprecated
- func NXPtrHash(info unsafe.Pointer, data unsafe.Pointer) uintptrdeprecated
- func NXPtrIsEqual(info unsafe.Pointer, data1 unsafe.Pointer, data2 unsafe.Pointer) int32deprecated
- func NXReallyFree(info unsafe.Pointer, data unsafe.Pointer)deprecated
- func NXResetHashTable(table *NXHashTable)deprecated
- func NXStrHash(info unsafe.Pointer, data unsafe.Pointer) uintptrdeprecated
- func NXStrIsEqual(info unsafe.Pointer, data1 unsafe.Pointer, data2 unsafe.Pointer) int32deprecated
- func NumberSliceToNSArray[T any](slice []T) objc.ID
- func NumberToID[T any](v T) objc.ID
- func Objc_addExceptionHandler(fn unsafe.Pointer, context unsafe.Pointer) uintptr
- func Objc_addLoadImageFunc(func_ unsafe.Pointer)
- func Objc_allocateClassPair(superclass objc.Class, name string, extraBytes uintptr) objc.Class
- func Objc_copyClassList(outCount *uint32) objc.Class
- func Objc_copyClassNamesForImage(image string, outCount *uint32) **byte
- func Objc_copyImageNames(outCount *uint32) **byte
- func Objc_destructInstance(obj Object) unsafe.Pointer
- func Objc_disposeClassPair(cls objc.Class)
- func Objc_duplicateClass(original objc.Class, name string, extraBytes uintptr) objc.Class
- func Objc_end_catch()
- func Objc_enumerateClasses(image unsafe.Pointer, namePrefix string, conformingTo *Protocol, ...)
- func Objc_enumerationMutation(obj Object)
- func Objc_exception_rethrow()
- func Objc_exception_throw(exception Object)
- func Objc_getClassList(buffer objc.Class, bufferCount int32) int32
- func Objc_getFutureClass(name string) objc.Class
- func Objc_getRequiredClass(name string) objc.Class
- func Objc_lookUpClass(name string) objc.Class
- func Objc_msgSend()
- func Objc_msgSendSuper()
- func Objc_registerClassPair(cls objc.Class)
- func Objc_registerProtocol(proto *Protocol)
- func Objc_removeAssociatedObjects(object Object)
- func Objc_removeExceptionHandler(token uintptr)
- func Objc_setAssociatedObject(object Object, key unsafe.Pointer, value Object, policy Objc_AssociationPolicy)
- func Objc_setEnumerationMutationHandler(handler func(Object))
- func Objc_setExceptionMatcher(fn unsafe.Pointer) unsafe.Pointer
- func Objc_setExceptionPreprocessor(fn unsafe.Pointer) unsafe.Pointer
- func Objc_setForwardHandler(fwd unsafe.Pointer, fwd_stret unsafe.Pointer)
- func Objc_setHook_getClass(newValue unsafe.Pointer, outOldValue *Objc_hook_getClass)
- func Objc_setHook_getImageName(newValue unsafe.Pointer, outOldValue *Objc_hook_getImageName)
- func Objc_setHook_lazyClassNamer(newValue unsafe.Pointer, oldOutValue *Objc_hook_lazyClassNamer)
- func Objc_setUncaughtExceptionHandler(fn unsafe.Pointer) unsafe.Pointer
- func Objc_sync_enter(obj Object) int32
- func Objc_sync_exit(obj Object) int32
- func Objc_terminate()
- func Object_getClass(obj Object) objc.Class
- func Object_getClassName(obj Object) *byte
- func Object_getIndexedIvars(obj Object) unsafe.Pointer
- func Object_isClass(obj Object) bool
- func Object_setClass(obj Object, cls objc.Class) objc.Class
- func Object_setIvar(obj Object, ivar Ivar, value Object)
- func Object_setIvarWithStrongDefault(obj Object, ivar Ivar, value Object)
- func Property_copyAttributeValue(property unsafe.Pointer, attributeName string) *byte
- func Property_getAttributes(property unsafe.Pointer) *byte
- func Property_getName(property unsafe.Pointer) *byte
- func Protocol_addMethodDescription(proto *Protocol, name SEL, types string, isRequiredMethod bool, ...)
- func Protocol_addProperty(proto *Protocol, name string, attributes *Objc_property_attribute_t, ...)
- func Protocol_addProtocol(proto *Protocol, addition *Protocol)
- func Protocol_conformsToProtocol(proto *Protocol, other *Protocol) bool
- func Protocol_getName(proto *Protocol) *byte
- func Protocol_getProperty(proto *Protocol, name string, isRequiredProperty bool, isInstanceProperty bool) unsafe.Pointer
- func Protocol_isEqual(proto *Protocol, other *Protocol) bool
- func Sel_getName(sel SEL) *byte
- func Sel_isEqual(lhs SEL, rhs SEL) bool
- func Sel_isMapped(sel SEL) bool
- func SliceToNSArray[T any](slice []T, toID func(T) objc.ID) objc.ID
- func StringSliceToNSArray(slice []string) objc.ID
- func SymbolAddress(name string) (uintptr, error)
- func TryClass_addIvar(cls objc.Class, name string, size uintptr, alignment uint8, types string) (bool, error)
- func TryClass_addMethod(cls objc.Class, name SEL, imp IMP, types string) (bool, error)
- func TryClass_addProperty(cls objc.Class, name string, attributes *Objc_property_attribute_t, ...) (bool, error)
- func TryClass_addProtocol(cls objc.Class, protocol_ *Protocol) (bool, error)
- func TryClass_conformsToProtocol(cls objc.Class, protocol_ *Protocol) (bool, error)
- func TryClass_getImageName(cls objc.Class) (*byte, error)
- func TryClass_getInstanceSize(cls objc.Class) (uintptr, error)
- func TryClass_getIvarLayout(cls objc.Class) (*uint8, error)
- func TryClass_getName(cls objc.Class) (*byte, error)
- func TryClass_getProperty(cls objc.Class, name string) (unsafe.Pointer, error)
- func TryClass_getSuperclass(cls objc.Class) (objc.Class, error)
- func TryClass_getVersion(cls objc.Class) (int32, error)
- func TryClass_getWeakIvarLayout(cls objc.Class) (*uint8, error)
- func TryClass_isMetaClass(cls objc.Class) (bool, error)
- func TryClass_replaceProperty(cls objc.Class, name string, attributes *Objc_property_attribute_t, ...) error
- func TryClass_respondsToSelector(cls objc.Class, sel SEL) (bool, error)
- func TryClass_setIvarLayout(cls objc.Class, layout []byte) error
- func TryClass_setVersion(cls objc.Class, version int32) error
- func TryClass_setWeakIvarLayout(cls objc.Class, layout []byte) error
- func TryImp_removeBlock(anImp IMP) (bool, error)
- func TryIvar_getName(v Ivar) (*byte, error)
- func TryIvar_getOffset(v Ivar) (int, error)
- func TryIvar_getTypeEncoding(v Ivar) (*byte, error)
- func TryMethod_copyArgumentType(m Method, index uint32) (*byte, error)
- func TryMethod_copyReturnType(m Method) (*byte, error)
- func TryMethod_exchangeImplementations(m1 Method, m2 Method) error
- func TryMethod_getArgumentType(m Method, index uint32, dst *byte, dst_len uintptr) error
- func TryMethod_getNumberOfArguments(m Method) (uint32, error)
- func TryMethod_getReturnType(m Method, dst *byte, dst_len uintptr) error
- func TryMethod_getTypeEncoding(m Method) (*byte, error)
- func TryMethod_invoke() error
- func TryNXCompareHashTables(table1 *NXHashTable, table2 *NXHashTable) (bool, error)
- func TryNXCountHashTable(table *NXHashTable) (uint32, error)
- func TryNXEmptyHashTable(table *NXHashTable) error
- func TryNXFreeHashTable(table *NXHashTable) error
- func TryNXHashGet(table *NXHashTable, data unsafe.Pointer) (unsafe.Pointer, error)
- func TryNXHashInsert(table *NXHashTable, data unsafe.Pointer) (unsafe.Pointer, error)
- func TryNXHashInsertIfAbsent(table *NXHashTable, data unsafe.Pointer) (unsafe.Pointer, error)
- func TryNXHashMember(table *NXHashTable, data unsafe.Pointer) (int32, error)
- func TryNXHashRemove(table *NXHashTable, data unsafe.Pointer) (unsafe.Pointer, error)
- func TryNXNextHashState(table *NXHashTable, state *NXHashState, data unsafe.Pointer) (int32, error)
- func TryNXNoEffectFree(info unsafe.Pointer, data unsafe.Pointer) error
- func TryNXPtrHash(info unsafe.Pointer, data unsafe.Pointer) (uintptr, error)
- func TryNXPtrIsEqual(info unsafe.Pointer, data1 unsafe.Pointer, data2 unsafe.Pointer) (int32, error)
- func TryNXReallyFree(info unsafe.Pointer, data unsafe.Pointer) error
- func TryNXResetHashTable(table *NXHashTable) error
- func TryNXStrHash(info unsafe.Pointer, data unsafe.Pointer) (uintptr, error)
- func TryNXStrIsEqual(info unsafe.Pointer, data1 unsafe.Pointer, data2 unsafe.Pointer) (int32, error)
- func TryObjc_addExceptionHandler(fn unsafe.Pointer, context unsafe.Pointer) (uintptr, error)
- func TryObjc_addLoadImageFunc(func_ unsafe.Pointer) error
- func TryObjc_allocateClassPair(superclass objc.Class, name string, extraBytes uintptr) (objc.Class, error)
- func TryObjc_copyClassList(outCount *uint32) (objc.Class, error)
- func TryObjc_copyClassNamesForImage(image string, outCount *uint32) (**byte, error)
- func TryObjc_copyImageNames(outCount *uint32) (**byte, error)
- func TryObjc_destructInstance(obj Object) (unsafe.Pointer, error)
- func TryObjc_disposeClassPair(cls objc.Class) error
- func TryObjc_duplicateClass(original objc.Class, name string, extraBytes uintptr) (objc.Class, error)
- func TryObjc_end_catch() error
- func TryObjc_enumerateClasses(image unsafe.Pointer, namePrefix string, conformingTo *Protocol, ...) error
- func TryObjc_enumerationMutation(obj Object) error
- func TryObjc_exception_rethrow() error
- func TryObjc_exception_throw(exception Object) error
- func TryObjc_getClassList(buffer objc.Class, bufferCount int32) (int32, error)
- func TryObjc_getFutureClass(name string) (objc.Class, error)
- func TryObjc_getRequiredClass(name string) (objc.Class, error)
- func TryObjc_lookUpClass(name string) (objc.Class, error)
- func TryObjc_msgSend() error
- func TryObjc_msgSendSuper() error
- func TryObjc_registerClassPair(cls objc.Class) error
- func TryObjc_registerProtocol(proto *Protocol) error
- func TryObjc_removeAssociatedObjects(object Object) error
- func TryObjc_removeExceptionHandler(token uintptr) error
- func TryObjc_setAssociatedObject(object Object, key unsafe.Pointer, value Object, policy Objc_AssociationPolicy) error
- func TryObjc_setEnumerationMutationHandler(handler func(Object)) error
- func TryObjc_setExceptionMatcher(fn unsafe.Pointer) (unsafe.Pointer, error)
- func TryObjc_setExceptionPreprocessor(fn unsafe.Pointer) (unsafe.Pointer, error)
- func TryObjc_setForwardHandler(fwd unsafe.Pointer, fwd_stret unsafe.Pointer) error
- func TryObjc_setHook_getClass(newValue unsafe.Pointer, outOldValue *Objc_hook_getClass) error
- func TryObjc_setHook_getImageName(newValue unsafe.Pointer, outOldValue *Objc_hook_getImageName) error
- func TryObjc_setHook_lazyClassNamer(newValue unsafe.Pointer, oldOutValue *Objc_hook_lazyClassNamer) error
- func TryObjc_setUncaughtExceptionHandler(fn unsafe.Pointer) (unsafe.Pointer, error)
- func TryObjc_sync_enter(obj Object) (int32, error)
- func TryObjc_sync_exit(obj Object) (int32, error)
- func TryObjc_terminate() error
- func TryObject_getClass(obj Object) (objc.Class, error)
- func TryObject_getClassName(obj Object) (*byte, error)
- func TryObject_getIndexedIvars(obj Object) (unsafe.Pointer, error)
- func TryObject_isClass(obj Object) (bool, error)
- func TryObject_setClass(obj Object, cls objc.Class) (objc.Class, error)
- func TryObject_setIvar(obj Object, ivar Ivar, value Object) error
- func TryObject_setIvarWithStrongDefault(obj Object, ivar Ivar, value Object) error
- func TryProperty_copyAttributeValue(property unsafe.Pointer, attributeName string) (*byte, error)
- func TryProperty_getAttributes(property unsafe.Pointer) (*byte, error)
- func TryProperty_getName(property unsafe.Pointer) (*byte, error)
- func TryProtocol_addMethodDescription(proto *Protocol, name SEL, types string, isRequiredMethod bool, ...) error
- func TryProtocol_addProperty(proto *Protocol, name string, attributes *Objc_property_attribute_t, ...) error
- func TryProtocol_addProtocol(proto *Protocol, addition *Protocol) error
- func TryProtocol_conformsToProtocol(proto *Protocol, other *Protocol) (bool, error)
- func TryProtocol_getName(proto *Protocol) (*byte, error)
- func TryProtocol_getProperty(proto *Protocol, name string, isRequiredProperty bool, isInstanceProperty bool) (unsafe.Pointer, error)
- func TryProtocol_isEqual(proto *Protocol, other *Protocol) (bool, error)
- func TrySel_getName(sel SEL) (*byte, error)
- func TrySel_isEqual(lhs SEL, rhs SEL) (bool, error)
- func TrySel_isMapped(sel SEL) (bool, error)
- type BOOL
- type Category
- type Class
- type IMP
- func Class_getMethodImplementation(cls objc.Class, name SEL) IMP
- func Class_replaceMethod(cls objc.Class, name SEL, imp IMP, types string) IMP
- func Imp_implementationWithBlock(block Object) IMP
- func Method_getImplementation(m Method) IMP
- func Method_setImplementation(m Method, imp IMP) IMP
- func TryClass_getMethodImplementation(cls objc.Class, name SEL) (IMP, error)
- func TryClass_replaceMethod(cls objc.Class, name SEL, imp IMP, types string) (IMP, error)
- func TryImp_implementationWithBlock(block Object) (IMP, error)
- func TryMethod_getImplementation(m Method) (IMP, error)
- func TryMethod_setImplementation(m Method, imp IMP) (IMP, error)
- type IObject
- type IProtocol
- type Id
- type Ivar
- func Class_copyIvarList(cls objc.Class, outCount *uint32) Ivar
- func Class_getClassVariable(cls objc.Class, name string) Ivar
- func Class_getInstanceVariable(cls objc.Class, name string) Ivar
- func Object_getInstanceVariable(obj Object, name string, outValue unsafe.Pointer) Ivar
- func Object_setInstanceVariable(obj Object, name string, value unsafe.Pointer) Ivar
- func Object_setInstanceVariableWithStrongDefault(obj Object, name string, value unsafe.Pointer) Ivar
- func TryClass_copyIvarList(cls objc.Class, outCount *uint32) (Ivar, error)
- func TryClass_getClassVariable(cls objc.Class, name string) (Ivar, error)
- func TryClass_getInstanceVariable(cls objc.Class, name string) (Ivar, error)
- func TryObject_getInstanceVariable(obj Object, name string, outValue unsafe.Pointer) (Ivar, error)
- func TryObject_setInstanceVariable(obj Object, name string, value unsafe.Pointer) (Ivar, error)
- func TryObject_setInstanceVariableWithStrongDefault(obj Object, name string, value unsafe.Pointer) (Ivar, error)
- type Method
- func Class_copyMethodList(cls objc.Class, outCount *uint32) Method
- func Class_getClassMethod(cls objc.Class, name SEL) Method
- func Class_getInstanceMethod(cls objc.Class, name SEL) Method
- func TryClass_copyMethodList(cls objc.Class, outCount *uint32) (Method, error)
- func TryClass_getClassMethod(cls objc.Class, name SEL) (Method, error)
- func TryClass_getInstanceMethod(cls objc.Class, name SEL) (Method, error)
- type NSInteger
- type NSObject
- type NSObjectObject
- func (o NSObjectObject) BaseObject() Object
- func (o NSObjectObject) Class() objc.Class
- func (o NSObjectObject) ConformsToProtocol(aProtocol *Protocol) bool
- func (o NSObjectObject) DebugDescription() IObject
- func (o NSObjectObject) Description() IObject
- func (o NSObjectObject) Hash() uint
- func (o NSObjectObject) IsEqual(object IObject) bool
- func (o NSObjectObject) IsKindOfClass(aClass Class) bool
- func (o NSObjectObject) IsMemberOfClass(aClass Class) bool
- func (o NSObjectObject) IsProxy() bool
- func (o NSObjectObject) PerformSelector(aSelector SEL) IObject
- func (o NSObjectObject) PerformSelectorWithObject(aSelector SEL, object IObject) IObject
- func (o NSObjectObject) PerformSelectorWithObjectWithObject(aSelector SEL, object1 IObject, object2 IObject) IObject
- func (o NSObjectObject) Release()
- func (o NSObjectObject) RespondsToSelector(aSelector SEL) bool
- func (o NSObjectObject) Retain() objc.ID
- func (o NSObjectObject) RetainCount() uint
- func (o NSObjectObject) Self() objc.ID
- func (o NSObjectObject) Superclass() objc.Class
- type NSUInteger
- type NXHashState
- type NXHashTable
- func NXCopyHashTable(table *NXHashTable) *NXHashTabledeprecated
- func NXCreateHashTable(prototype NXHashTablePrototype, capacity uint32, info unsafe.Pointer) *NXHashTabledeprecated
- func NXCreateHashTableFromZone(prototype NXHashTablePrototype, capacity uint32, info unsafe.Pointer, ...) *NXHashTabledeprecated
- func TryNXCopyHashTable(table *NXHashTable) (*NXHashTable, error)
- func TryNXCreateHashTable(prototype NXHashTablePrototype, capacity uint32, info unsafe.Pointer) (*NXHashTable, error)
- func TryNXCreateHashTableFromZone(prototype NXHashTablePrototype, capacity uint32, info unsafe.Pointer, ...) (*NXHashTable, error)
- type NXHashTablePrototype
- type ObjC
- type ObjCClearResident
- type ObjCSync
- type ObjcAssociationPolicy
- type ObjcExceptionHandler
- type ObjcExceptionMatcher
- type ObjcExceptionPreprocessor
- type ObjcFuncLoadImage
- type ObjcHookGetClass
- type ObjcHookGetImageName
- type ObjcHookLazyClassNamer
- type ObjcObjectptr
- type ObjcProperty
- type ObjcUncaughtExceptionHandler
- type ObjcZone
- type Objc_AssociationPolicy
- type Objc_associationPolicy
- type Objc_category
- type Objc_class
- type Objc_exception_handler
- type Objc_exception_matcher
- type Objc_exception_preprocessor
- type Objc_func_loadImage
- type Objc_hook_getClass
- type Objc_hook_getImageName
- type Objc_hook_lazyClassNamer
- type Objc_ivar
- type Objc_method
- type Objc_method_description
- func Method_getDescription(m Method) *Objc_method_description
- func Protocol_copyMethodDescriptionList(proto *Protocol, isRequiredMethod bool, isInstanceMethod bool, ...) *Objc_method_description
- func Protocol_getMethodDescription(proto *Protocol, aSel SEL, isRequiredMethod bool, isInstanceMethod bool) Objc_method_description
- func TryMethod_getDescription(m Method) (*Objc_method_description, error)
- func TryProtocol_copyMethodDescriptionList(proto *Protocol, isRequiredMethod bool, isInstanceMethod bool, ...) (*Objc_method_description, error)
- func TryProtocol_getMethodDescription(proto *Protocol, aSel SEL, isRequiredMethod bool, isInstanceMethod bool) (Objc_method_description, error)
- type Objc_object
- type Objc_objectptr_t
- type Objc_property
- type Objc_property_attribute_t
- type Objc_property_t
- func Class_copyPropertyList(cls objc.Class, outCount *uint32) *Objc_property_t
- func Protocol_copyPropertyList(proto *Protocol, outCount *uint32) *Objc_property_t
- func Protocol_copyPropertyList2(proto *Protocol, outCount *uint32, isRequiredProperty bool, ...) *Objc_property_t
- func TryClass_copyPropertyList(cls objc.Class, outCount *uint32) (*Objc_property_t, error)
- func TryProtocol_copyPropertyList(proto *Protocol, outCount *uint32) (*Objc_property_t, error)
- func TryProtocol_copyPropertyList2(proto *Protocol, outCount *uint32, isRequiredProperty bool, ...) (*Objc_property_t, error)
- type Objc_selector
- type Objc_super
- type Objc_uncaught_exception_handler
- type Objc_zone_t
- type Object
- func Class_createInstance(cls objc.Class, extraBytes uintptr) Object
- func Class_createInstanceFromZone(arg0 objc.Class, idxIvars uintptr, zone unsafe.Pointer) Objectdeprecated
- func Imp_getBlock(anImp IMP) Object
- func Objc_begin_catch(exc_buf unsafe.Pointer) Object
- func Objc_constructInstance(cls objc.Class, bytes unsafe.Pointer) Object
- func Objc_getAssociatedObject(object Object, key unsafe.Pointer) Object
- func Objc_getClass(name string) Object
- func Objc_getMetaClass(name string) Object
- func Objc_loadWeak(location objc.ID) Object
- func Objc_storeWeak(location objc.ID, obj Object) Object
- func ObjectFromID(id objc.ID) Object
- func Object_copy(obj Object, size uintptr) Object
- func Object_copyFromZone(anObject Object, nBytes uintptr, zone unsafe.Pointer) Objectdeprecated
- func Object_dispose(obj Object) Object
- func Object_getIvar(obj Object, ivar Ivar) Object
- func TryClass_createInstance(cls objc.Class, extraBytes uintptr) (Object, error)
- func TryClass_createInstanceFromZone(arg0 objc.Class, idxIvars uintptr, zone unsafe.Pointer) (Object, error)
- func TryImp_getBlock(anImp IMP) (Object, error)
- func TryObjc_begin_catch(exc_buf unsafe.Pointer) (Object, error)
- func TryObjc_constructInstance(cls objc.Class, bytes unsafe.Pointer) (Object, error)
- func TryObjc_getAssociatedObject(object Object, key unsafe.Pointer) (Object, error)
- func TryObjc_getClass(name string) (Object, error)
- func TryObjc_getMetaClass(name string) (Object, error)
- func TryObjc_loadWeak(location objc.ID) (Object, error)
- func TryObjc_storeWeak(location objc.ID, obj Object) (Object, error)
- func TryObject_copy(obj Object, size uintptr) (Object, error)
- func TryObject_copyFromZone(anObject Object, nBytes uintptr, zone unsafe.Pointer) (Object, error)
- func TryObject_dispose(obj Object) (Object, error)
- func TryObject_getIvar(obj Object, ivar Ivar) (Object, error)
- type Protocol
- func Class_copyProtocolList(cls objc.Class, outCount *uint32) **Protocol
- func NewProtocol() Protocol
- func Objc_allocateProtocol(name string) *Protocol
- func Objc_copyProtocolList(outCount *uint32) **Protocol
- func Objc_getProtocol(name string) *Protocol
- func ProtocolFromID(id objc.ID) Protocol
- func Protocol_copyProtocolList(proto *Protocol, outCount *uint32) **Protocol
- func TryClass_copyProtocolList(cls objc.Class, outCount *uint32) (**Protocol, error)
- func TryObjc_allocateProtocol(name string) (*Protocol, error)
- func TryObjc_copyProtocolList(outCount *uint32) (**Protocol, error)
- func TryObjc_getProtocol(name string) (*Protocol, error)
- func TryProtocol_copyProtocolList(proto *Protocol, outCount *uint32) (**Protocol, error)
- type ProtocolClass
- type SEL
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BindFunc ¶
BindFunc binds the ObjectiveC symbol name into fptr, which must be a pointer to a func variable.
The caller supplies the signature, and nothing checks it. A dylib records no argument count or types for a C symbol, so a wrong signature here is not a type error: it is the wrong number of machine words moved on a live stack, and the failure surfaces somewhere else entirely. Prefer a generated binding, whose signature carries recorded evidence, and reach for this only for a symbol that has none. purego.RegisterFunc panics on a signature it cannot lower; that is recovered and returned, because an escape hatch that takes down the process on a mistyped experiment is not one anybody can experiment with.
func ClassSliceToNSArray ¶
ClassSliceToNSArray converts a slice of objc.Class to an NSArray.
func Class_addIvar ¶
Class_addIvar adds a new instance variable to a class.
It panics if class_addIvar is unavailable at run time; use TryClass_addIvar to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/class_addIvar(_:_:_:_:_:)
func Class_addMethod ¶
Class_addMethod adds a new method to a class with a given name and implementation.
It panics if class_addMethod is unavailable at run time; use TryClass_addMethod to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/class_addMethod(_:_:_:_:)
func Class_addProperty ¶
func Class_addProperty(cls objc.Class, name string, attributes *Objc_property_attribute_t, attributeCount uint32) bool
Class_addProperty adds a property to a class.
It panics if class_addProperty is unavailable at run time; use TryClass_addProperty to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/class_addProperty(_:_:_:_:)
func Class_addProtocol ¶
Class_addProtocol adds a protocol to a class.
It panics if class_addProtocol is unavailable at run time; use TryClass_addProtocol to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/class_addProtocol(_:_:)
func Class_conformsToProtocol ¶
Class_conformsToProtocol returns a Boolean value that indicates whether a class conforms to a given protocol.
It panics if class_conformsToProtocol is unavailable at run time; use TryClass_conformsToProtocol to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/class_conformsToProtocol(_:_:)
func Class_getImageName ¶
Class_getImageName returns the name of the dynamic library a class originated from.
It panics if class_getImageName is unavailable at run time; use TryClass_getImageName to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/class_getImageName(_:)
func Class_getInstanceSize ¶
Class_getInstanceSize returns the size of instances of a class.
It panics if class_getInstanceSize is unavailable at run time; use TryClass_getInstanceSize to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/class_getInstanceSize(_:)
func Class_getIvarLayout ¶
Class_getIvarLayout returns a description of the Ivar layout for a given class.
It panics if class_getIvarLayout is unavailable at run time; use TryClass_getIvarLayout to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/class_getIvarLayout(_:)
func Class_getName ¶
Class_getName returns the name of a class.
It panics if class_getName is unavailable at run time; use TryClass_getName to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/class_getName(_:)
func Class_getProperty ¶
Class_getProperty returns a property with a given name of a given class.
It panics if class_getProperty is unavailable at run time; use TryClass_getProperty to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/class_getProperty(_:_:)
func Class_getSuperclass ¶
Class_getSuperclass returns the superclass of a class.
It panics if class_getSuperclass is unavailable at run time; use TryClass_getSuperclass to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/class_getSuperclass(_:)
func Class_getVersion ¶
Class_getVersion returns the version number of a class definition.
It panics if class_getVersion is unavailable at run time; use TryClass_getVersion to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/class_getVersion(_:)
func Class_getWeakIvarLayout ¶
Class_getWeakIvarLayout returns a description of the layout of weak [Ivar]s for a given class.
It panics if class_getWeakIvarLayout is unavailable at run time; use TryClass_getWeakIvarLayout to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/class_getWeakIvarLayout(_:)
func Class_isMetaClass ¶
Class_isMetaClass returns a Boolean value that indicates whether a class object is a metaclass.
It panics if class_isMetaClass is unavailable at run time; use TryClass_isMetaClass to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/class_isMetaClass(_:)
func Class_replaceProperty ¶
func Class_replaceProperty(cls objc.Class, name string, attributes *Objc_property_attribute_t, attributeCount uint32)
Class_replaceProperty replace a property of a class.
It panics if class_replaceProperty is unavailable at run time; use TryClass_replaceProperty to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/class_replaceProperty(_:_:_:_:)
func Class_respondsToSelector ¶
Class_respondsToSelector returns a Boolean value that indicates whether instances of a class respond to a particular selector.
It panics if class_respondsToSelector is unavailable at run time; use TryClass_respondsToSelector to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/class_respondsToSelector(_:_:)
func Class_setIvarLayout ¶
Class_setIvarLayout sets the Ivar layout for a given class.
It panics if class_setIvarLayout is unavailable at run time; use TryClass_setIvarLayout to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/class_setIvarLayout(_:_:)
func Class_setVersion ¶
Class_setVersion sets the version number of a class definition.
It panics if class_setVersion is unavailable at run time; use TryClass_setVersion to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/class_setVersion(_:_:)
func Class_setWeakIvarLayout ¶
Class_setWeakIvarLayout sets the layout for weak [Ivar]s for a given class.
It panics if class_setWeakIvarLayout is unavailable at run time; use TryClass_setWeakIvarLayout to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/class_setWeakIvarLayout(_:_:)
func IDSliceToNSArray ¶
IDSliceToNSArray converts a slice of objc.ID to an NSArray.
func IObjectSliceToNSArray ¶
IObjectSliceToNSArray converts a slice of IObject-implementing types to an NSArray.
func Imp_removeBlock ¶
Imp_removeBlock disassociates a block from an IMP that was created using imp_implementationWithBlock(_:), and releases the copy of the block that was created.
It panics if imp_removeBlock is unavailable at run time; use TryImp_removeBlock to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/imp_removeBlock(_:)
func Ivar_getName ¶
Ivar_getName returns the name of an instance variable.
It panics if ivar_getName is unavailable at run time; use TryIvar_getName to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/ivar_getName(_:)
func Ivar_getOffset ¶
Ivar_getOffset returns the offset of an instance variable.
It panics if ivar_getOffset is unavailable at run time; use TryIvar_getOffset to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/ivar_getOffset(_:)
func Ivar_getTypeEncoding ¶
Ivar_getTypeEncoding returns the type string of an instance variable.
It panics if ivar_getTypeEncoding is unavailable at run time; use TryIvar_getTypeEncoding to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/ivar_getTypeEncoding(_:)
func Method_copyArgumentType ¶
Method_copyArgumentType returns a string describing a single parameter type of a method.
It panics if method_copyArgumentType is unavailable at run time; use TryMethod_copyArgumentType to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/method_copyArgumentType(_:_:)
func Method_copyReturnType ¶
Method_copyReturnType returns a string describing a method’s return type.
It panics if method_copyReturnType is unavailable at run time; use TryMethod_copyReturnType to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/method_copyReturnType(_:)
func Method_exchangeImplementations ¶
Method_exchangeImplementations exchanges the implementations of two methods.
It panics if method_exchangeImplementations is unavailable at run time; use TryMethod_exchangeImplementations to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/method_exchangeImplementations(_:_:)
func Method_getArgumentType ¶
Method_getArgumentType returns by reference a string describing a single parameter type of a method.
It panics if method_getArgumentType is unavailable at run time; use TryMethod_getArgumentType to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/method_getArgumentType(_:_:_:_:)
func Method_getNumberOfArguments ¶
Method_getNumberOfArguments returns the number of arguments accepted by a method.
It panics if method_getNumberOfArguments is unavailable at run time; use TryMethod_getNumberOfArguments to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/method_getNumberOfArguments(_:)
func Method_getReturnType ¶
Method_getReturnType returns by reference a string describing a method’s return type.
It panics if method_getReturnType is unavailable at run time; use TryMethod_getReturnType to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/method_getReturnType(_:_:_:)
func Method_getTypeEncoding ¶
Method_getTypeEncoding returns a string describing a method’s parameter and return types.
It panics if method_getTypeEncoding is unavailable at run time; use TryMethod_getTypeEncoding to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/method_getTypeEncoding(_:)
func Method_invoke ¶
func Method_invoke()
Method_invoke calls the implementation of a specified method.
It panics if method_invoke is unavailable at run time; use TryMethod_invoke to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/method_invoke
func NXCompareHashTables
deprecated
func NXCompareHashTables(table1 *NXHashTable, table2 *NXHashTable) bool
NXCompareHashTables.
It panics if NXCompareHashTables is unavailable at run time; use TryNXCompareHashTables to get an error instead.
Deprecated: Deprecated since macOS 10.1.
See: https://developer.apple.com/documentation/ObjectiveC/NXCompareHashTables
func NXCountHashTable
deprecated
func NXCountHashTable(table *NXHashTable) uint32
NXCountHashTable.
It panics if NXCountHashTable is unavailable at run time; use TryNXCountHashTable to get an error instead.
Deprecated: Deprecated since macOS 10.1.
See: https://developer.apple.com/documentation/ObjectiveC/NXCountHashTable
func NXEmptyHashTable
deprecated
func NXEmptyHashTable(table *NXHashTable)
NXEmptyHashTable.
It panics if NXEmptyHashTable is unavailable at run time; use TryNXEmptyHashTable to get an error instead.
Deprecated: Deprecated since macOS 10.1.
See: https://developer.apple.com/documentation/ObjectiveC/NXEmptyHashTable
func NXFreeHashTable
deprecated
func NXFreeHashTable(table *NXHashTable)
NXFreeHashTable.
It panics if NXFreeHashTable is unavailable at run time; use TryNXFreeHashTable to get an error instead.
Deprecated: Deprecated since macOS 10.1.
See: https://developer.apple.com/documentation/ObjectiveC/NXFreeHashTable
func NXHashGet
deprecated
func NXHashGet(table *NXHashTable, data unsafe.Pointer) unsafe.Pointer
NXHashGet.
It panics if NXHashGet is unavailable at run time; use TryNXHashGet to get an error instead.
Deprecated: Deprecated since macOS 10.1.
See: https://developer.apple.com/documentation/ObjectiveC/NXHashGet
func NXHashInsert
deprecated
func NXHashInsert(table *NXHashTable, data unsafe.Pointer) unsafe.Pointer
NXHashInsert.
It panics if NXHashInsert is unavailable at run time; use TryNXHashInsert to get an error instead.
Deprecated: Deprecated since macOS 10.1.
See: https://developer.apple.com/documentation/ObjectiveC/NXHashInsert
func NXHashInsertIfAbsent
deprecated
func NXHashInsertIfAbsent(table *NXHashTable, data unsafe.Pointer) unsafe.Pointer
NXHashInsertIfAbsent.
It panics if NXHashInsertIfAbsent is unavailable at run time; use TryNXHashInsertIfAbsent to get an error instead.
Deprecated: Deprecated since macOS 10.1.
See: https://developer.apple.com/documentation/ObjectiveC/NXHashInsertIfAbsent
func NXHashMember
deprecated
func NXHashMember(table *NXHashTable, data unsafe.Pointer) int32
NXHashMember.
It panics if NXHashMember is unavailable at run time; use TryNXHashMember to get an error instead.
Deprecated: Deprecated since macOS 10.1.
See: https://developer.apple.com/documentation/ObjectiveC/NXHashMember
func NXHashRemove
deprecated
func NXHashRemove(table *NXHashTable, data unsafe.Pointer) unsafe.Pointer
NXHashRemove.
It panics if NXHashRemove is unavailable at run time; use TryNXHashRemove to get an error instead.
Deprecated: Deprecated since macOS 10.1.
See: https://developer.apple.com/documentation/ObjectiveC/NXHashRemove
func NXNextHashState
deprecated
func NXNextHashState(table *NXHashTable, state *NXHashState, data unsafe.Pointer) int32
NXNextHashState.
It panics if NXNextHashState is unavailable at run time; use TryNXNextHashState to get an error instead.
Deprecated: Deprecated since macOS 10.1.
See: https://developer.apple.com/documentation/ObjectiveC/NXNextHashState
func NXNoEffectFree
deprecated
NXNoEffectFree.
It panics if NXNoEffectFree is unavailable at run time; use TryNXNoEffectFree to get an error instead.
Deprecated: Deprecated since macOS 10.1.
See: https://developer.apple.com/documentation/ObjectiveC/NXNoEffectFree
func NXPtrHash
deprecated
NXPtrHash.
It panics if NXPtrHash is unavailable at run time; use TryNXPtrHash to get an error instead.
Deprecated: Deprecated since macOS 10.1.
See: https://developer.apple.com/documentation/ObjectiveC/NXPtrHash
func NXPtrIsEqual
deprecated
NXPtrIsEqual.
It panics if NXPtrIsEqual is unavailable at run time; use TryNXPtrIsEqual to get an error instead.
Deprecated: Deprecated since macOS 10.1.
See: https://developer.apple.com/documentation/ObjectiveC/NXPtrIsEqual
func NXReallyFree
deprecated
NXReallyFree.
It panics if NXReallyFree is unavailable at run time; use TryNXReallyFree to get an error instead.
Deprecated: Deprecated since macOS 10.1.
See: https://developer.apple.com/documentation/ObjectiveC/NXReallyFree
func NXResetHashTable
deprecated
func NXResetHashTable(table *NXHashTable)
NXResetHashTable.
It panics if NXResetHashTable is unavailable at run time; use TryNXResetHashTable to get an error instead.
Deprecated: Deprecated since macOS 10.1.
See: https://developer.apple.com/documentation/ObjectiveC/NXResetHashTable
func NXStrHash
deprecated
NXStrHash.
It panics if NXStrHash is unavailable at run time; use TryNXStrHash to get an error instead.
Deprecated: Deprecated since macOS 10.1.
See: https://developer.apple.com/documentation/ObjectiveC/NXStrHash
func NXStrIsEqual
deprecated
NXStrIsEqual.
It panics if NXStrIsEqual is unavailable at run time; use TryNXStrIsEqual to get an error instead.
Deprecated: Deprecated since macOS 10.1.
See: https://developer.apple.com/documentation/ObjectiveC/NXStrIsEqual
func NumberSliceToNSArray ¶ added in v0.6.17
NumberSliceToNSArray converts a slice of Go scalars to an NSArray of NSNumber objects. Each element is boxed by NumberToID.
func NumberToID ¶ added in v0.6.17
NumberToID boxes a Go scalar as an NSNumber. Signed integers, unsigned integers, floating-point values and bools are boxed with the matching NSNumber constructor. A value of any other kind has no NSNumber representation and is boxed as NSNull.
func Objc_addExceptionHandler ¶
Objc_addExceptionHandler.
It panics if objc_addExceptionHandler is unavailable at run time; use TryObjc_addExceptionHandler to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/objc_addExceptionHandler(_:_:)
func Objc_addLoadImageFunc ¶
Objc_addLoadImageFunc.
It panics if objc_addLoadImageFunc is unavailable at run time; use TryObjc_addLoadImageFunc to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/objc_addLoadImageFunc(_:)
func Objc_allocateClassPair ¶
Objc_allocateClassPair creates a new class and metaclass.
It panics if objc_allocateClassPair is unavailable at run time; use TryObjc_allocateClassPair to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/objc_allocateClassPair(_:_:_:)
func Objc_copyClassList ¶
Objc_copyClassList creates and returns a list of pointers to all registered class definitions.
It panics if objc_copyClassList is unavailable at run time; use TryObjc_copyClassList to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/objc_copyClassList(_:)
func Objc_copyClassNamesForImage ¶
Objc_copyClassNamesForImage returns the names of all the classes within a specified library or framework.
It panics if objc_copyClassNamesForImage is unavailable at run time; use TryObjc_copyClassNamesForImage to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/objc_copyClassNamesForImage(_:_:)
func Objc_copyImageNames ¶
Objc_copyImageNames returns the names of all the loaded Objective-C frameworks and dynamic libraries.
It panics if objc_copyImageNames is unavailable at run time; use TryObjc_copyImageNames to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/objc_copyImageNames(_:)
func Objc_destructInstance ¶
Objc_destructInstance destroys an instance of a class without freeing memory and removes any of its associated references.
It panics if objc_destructInstance is unavailable at run time; use TryObjc_destructInstance to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/objc_destructInstance
func Objc_disposeClassPair ¶
Objc_disposeClassPair destroys a class and its associated metaclass.
It panics if objc_disposeClassPair is unavailable at run time; use TryObjc_disposeClassPair to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/objc_disposeClassPair(_:)
func Objc_duplicateClass ¶
Objc_duplicateClass used by Foundation’s Key-Value Observing.
It panics if objc_duplicateClass is unavailable at run time; use TryObjc_duplicateClass to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/objc_duplicateClass(_:_:_:)
func Objc_end_catch ¶
func Objc_end_catch()
Objc_end_catch.
It panics if objc_end_catch is unavailable at run time; use TryObjc_end_catch to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/objc_end_catch()
func Objc_enumerateClasses ¶
func Objc_enumerateClasses(image unsafe.Pointer, namePrefix string, conformingTo *Protocol, subclassing objc.Class, block func(uintptr, *bool))
Objc_enumerateClasses.
It panics if objc_enumerateClasses is unavailable at run time; use TryObjc_enumerateClasses to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/objc_enumerateClasses
func Objc_enumerationMutation ¶
func Objc_enumerationMutation(obj Object)
Objc_enumerationMutation inserted by the compiler when a mutation is detected during a foreach iteration.
It panics if objc_enumerationMutation is unavailable at run time; use TryObjc_enumerationMutation to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/objc_enumerationMutation(_:)
func Objc_exception_rethrow ¶
func Objc_exception_rethrow()
Objc_exception_rethrow.
It panics if objc_exception_rethrow is unavailable at run time; use TryObjc_exception_rethrow to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/objc_exception_rethrow()
func Objc_exception_throw ¶
func Objc_exception_throw(exception Object)
Objc_exception_throw throw a runtime exception.
It panics if objc_exception_throw is unavailable at run time; use TryObjc_exception_throw to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/objc_exception_throw(_:)
func Objc_getClassList ¶
Objc_getClassList obtains the list of registered class definitions.
It panics if objc_getClassList is unavailable at run time; use TryObjc_getClassList to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/objc_getClassList(_:_:)
func Objc_getFutureClass ¶
Objc_getFutureClass used by CoreFoundation’s toll-free bridging.
It panics if objc_getFutureClass is unavailable at run time; use TryObjc_getFutureClass to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/objc_getFutureClass
func Objc_getRequiredClass ¶
Objc_getRequiredClass returns the class definition of a specified class.
It panics if objc_getRequiredClass is unavailable at run time; use TryObjc_getRequiredClass to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/objc_getRequiredClass(_:)
func Objc_lookUpClass ¶
Objc_lookUpClass returns the class definition of a specified class.
It panics if objc_lookUpClass is unavailable at run time; use TryObjc_lookUpClass to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/objc_lookUpClass(_:)
func Objc_msgSend ¶
func Objc_msgSend()
Objc_msgSend sends a message with a simple return value to an instance of a class.
It panics if objc_msgSend is unavailable at run time; use TryObjc_msgSend to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/objc_msgSend
func Objc_msgSendSuper ¶
func Objc_msgSendSuper()
Objc_msgSendSuper sends a message with a simple return value to the superclass of an instance of a class.
It panics if objc_msgSendSuper is unavailable at run time; use TryObjc_msgSendSuper to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/objc_msgSendSuper
func Objc_registerClassPair ¶
Objc_registerClassPair registers a class that was allocated using objc_allocateClassPair(_:_:_:).
It panics if objc_registerClassPair is unavailable at run time; use TryObjc_registerClassPair to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/objc_registerClassPair(_:)
func Objc_registerProtocol ¶
func Objc_registerProtocol(proto *Protocol)
Objc_registerProtocol registers a newly created protocol with the Objective-C runtime.
It panics if objc_registerProtocol is unavailable at run time; use TryObjc_registerProtocol to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/objc_registerProtocol(_:)
func Objc_removeAssociatedObjects ¶
func Objc_removeAssociatedObjects(object Object)
Objc_removeAssociatedObjects removes all associations for a given object.
It panics if objc_removeAssociatedObjects is unavailable at run time; use TryObjc_removeAssociatedObjects to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/objc_removeAssociatedObjects(_:)
func Objc_removeExceptionHandler ¶
func Objc_removeExceptionHandler(token uintptr)
Objc_removeExceptionHandler.
It panics if objc_removeExceptionHandler is unavailable at run time; use TryObjc_removeExceptionHandler to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/objc_removeExceptionHandler(_:)
func Objc_setAssociatedObject ¶ added in v0.2.0
func Objc_setAssociatedObject(object Object, key unsafe.Pointer, value Object, policy Objc_AssociationPolicy)
Objc_setAssociatedObject sets an associated value for a given object using a given key and association policy.
It panics if objc_setAssociatedObject is unavailable at run time; use TryObjc_setAssociatedObject to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/objc_setAssociatedObject(_:_:_:_:)
func Objc_setEnumerationMutationHandler ¶
func Objc_setEnumerationMutationHandler(handler func(Object))
Objc_setEnumerationMutationHandler sets the current mutation handler.
It panics if objc_setEnumerationMutationHandler is unavailable at run time; use TryObjc_setEnumerationMutationHandler to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/objc_setEnumerationMutationHandler(_:)
func Objc_setExceptionMatcher ¶
Objc_setExceptionMatcher.
It panics if objc_setExceptionMatcher is unavailable at run time; use TryObjc_setExceptionMatcher to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/objc_setExceptionMatcher(_:)
func Objc_setExceptionPreprocessor ¶
Objc_setExceptionPreprocessor.
It panics if objc_setExceptionPreprocessor is unavailable at run time; use TryObjc_setExceptionPreprocessor to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/objc_setExceptionPreprocessor(_:)
func Objc_setForwardHandler ¶
Objc_setForwardHandler set the function to be called by objc_msgForward.
It panics if objc_setForwardHandler is unavailable at run time; use TryObjc_setForwardHandler to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/objc_setForwardHandler(_:_:)
func Objc_setHook_getClass ¶
func Objc_setHook_getClass(newValue unsafe.Pointer, outOldValue *Objc_hook_getClass)
Objc_setHook_getClass.
It panics if objc_setHook_getClass is unavailable at run time; use TryObjc_setHook_getClass to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/objc_setHook_getClass(_:_:)
func Objc_setHook_getImageName ¶
func Objc_setHook_getImageName(newValue unsafe.Pointer, outOldValue *Objc_hook_getImageName)
Objc_setHook_getImageName.
It panics if objc_setHook_getImageName is unavailable at run time; use TryObjc_setHook_getImageName to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/objc_setHook_getImageName(_:_:)
func Objc_setHook_lazyClassNamer ¶
func Objc_setHook_lazyClassNamer(newValue unsafe.Pointer, oldOutValue *Objc_hook_lazyClassNamer)
Objc_setHook_lazyClassNamer.
It panics if objc_setHook_lazyClassNamer is unavailable at run time; use TryObjc_setHook_lazyClassNamer to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/objc_setHook_lazyClassNamer(_:_:)
func Objc_setUncaughtExceptionHandler ¶
Objc_setUncaughtExceptionHandler.
It panics if objc_setUncaughtExceptionHandler is unavailable at run time; use TryObjc_setUncaughtExceptionHandler to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/objc_setUncaughtExceptionHandler(_:)
func Objc_sync_enter ¶
Objc_sync_enter begin synchronizing on ‘obj’.
It panics if objc_sync_enter is unavailable at run time; use TryObjc_sync_enter to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/objc_sync_enter
func Objc_sync_exit ¶
Objc_sync_exit end synchronizing on ‘obj’.
It panics if objc_sync_exit is unavailable at run time; use TryObjc_sync_exit to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/objc_sync_exit
func Objc_terminate ¶
func Objc_terminate()
Objc_terminate.
It panics if objc_terminate is unavailable at run time; use TryObjc_terminate to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/objc_terminate()
func Object_getClass ¶
Object_getClass returns the class of an object.
It panics if object_getClass is unavailable at run time; use TryObject_getClass to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/object_getClass(_:)
func Object_getClassName ¶
Object_getClassName returns the class name of a given object.
It panics if object_getClassName is unavailable at run time; use TryObject_getClassName to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/object_getClassName(_:)
func Object_getIndexedIvars ¶
Object_getIndexedIvars returns a pointer to any extra bytes allocated with a instance given object.
It panics if object_getIndexedIvars is unavailable at run time; use TryObject_getIndexedIvars to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/object_getIndexedIvars(_:)
func Object_isClass ¶
Object_isClass.
It panics if object_isClass is unavailable at run time; use TryObject_isClass to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/object_isClass(_:)
func Object_setClass ¶
Object_setClass sets the class of an object.
It panics if object_setClass is unavailable at run time; use TryObject_setClass to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/object_setClass(_:_:)
func Object_setIvar ¶
Object_setIvar sets the value of an instance variable in an object.
It panics if object_setIvar is unavailable at run time; use TryObject_setIvar to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/object_setIvar(_:_:_:)
func Object_setIvarWithStrongDefault ¶
Object_setIvarWithStrongDefault.
It panics if object_setIvarWithStrongDefault is unavailable at run time; use TryObject_setIvarWithStrongDefault to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/object_setIvarWithStrongDefault(_:_:_:)
func Property_copyAttributeValue ¶
Property_copyAttributeValue returns the value of a property attribute given the attribute name.
It panics if property_copyAttributeValue is unavailable at run time; use TryProperty_copyAttributeValue to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/property_copyAttributeValue(_:_:)
func Property_getAttributes ¶
Property_getAttributes returns the attribute string of a property.
It panics if property_getAttributes is unavailable at run time; use TryProperty_getAttributes to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/property_getAttributes(_:)
func Property_getName ¶
Property_getName returns the name of a property.
It panics if property_getName is unavailable at run time; use TryProperty_getName to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/property_getName(_:)
func Protocol_addMethodDescription ¶
func Protocol_addMethodDescription(proto *Protocol, name SEL, types string, isRequiredMethod bool, isInstanceMethod bool)
Protocol_addMethodDescription adds a method to a protocol.
It panics if protocol_addMethodDescription is unavailable at run time; use TryProtocol_addMethodDescription to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/protocol_addMethodDescription(_:_:_:_:_:)
func Protocol_addProperty ¶
func Protocol_addProperty(proto *Protocol, name string, attributes *Objc_property_attribute_t, attributeCount uint32, isRequiredProperty bool, isInstanceProperty bool)
Protocol_addProperty adds a property to a protocol that is under construction.
It panics if protocol_addProperty is unavailable at run time; use TryProtocol_addProperty to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/protocol_addProperty(_:_:_:_:_:_:)
func Protocol_addProtocol ¶
Protocol_addProtocol adds a registered protocol to another protocol that is under construction.
It panics if protocol_addProtocol is unavailable at run time; use TryProtocol_addProtocol to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/protocol_addProtocol(_:_:)
func Protocol_conformsToProtocol ¶
Protocol_conformsToProtocol returns a Boolean value that indicates whether one protocol conforms to another protocol.
It panics if protocol_conformsToProtocol is unavailable at run time; use TryProtocol_conformsToProtocol to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/protocol_conformsToProtocol(_:_:)
func Protocol_getName ¶
Protocol_getName returns the name of a protocol.
It panics if protocol_getName is unavailable at run time; use TryProtocol_getName to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/protocol_getName(_:)
func Protocol_getProperty ¶
func Protocol_getProperty(proto *Protocol, name string, isRequiredProperty bool, isInstanceProperty bool) unsafe.Pointer
Protocol_getProperty returns the specified property of a given protocol.
It panics if protocol_getProperty is unavailable at run time; use TryProtocol_getProperty to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/protocol_getProperty(_:_:_:_:)
func Protocol_isEqual ¶
Protocol_isEqual returns a Boolean value that indicates whether two protocols are equal.
It panics if protocol_isEqual is unavailable at run time; use TryProtocol_isEqual to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/protocol_isEqual(_:_:)
func Sel_getName ¶
Sel_getName returns the name of the method specified by a given selector.
It panics if sel_getName is unavailable at run time; use TrySel_getName to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/sel_getName(_:)
func Sel_isEqual ¶
Sel_isEqual returns a Boolean value that indicates whether two selectors are equal.
It panics if sel_isEqual is unavailable at run time; use TrySel_isEqual to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/sel_isEqual(_:_:)
func Sel_isMapped ¶
Sel_isMapped identifies a selector as being valid or invalid.
It panics if sel_isMapped is unavailable at run time; use TrySel_isMapped to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/sel_isMapped(_:)
func SliceToNSArray ¶
SliceToNSArray converts a Go slice to an NSArray. The toID function extracts the objc.ID from each element. Returns an empty NSArray if the slice is empty. Note: The returned NSArray is autoreleased. If you need to keep it beyond the current autorelease pool scope, call Retain() on the result.
func StringSliceToNSArray ¶
StringSliceToNSArray converts a Go []string to an NSArray of NSString objects.
func SymbolAddress ¶
SymbolAddress returns the address of name in ObjectiveC, whether or not this package generated a binding for it.
What is generated is bounded by what is documented, and for a private framework that is whatever a manifest happened to enumerate. The dylib usually exports far more. Without this, a symbol nobody wrote down is unreachable from a package that has already loaded the image holding it, and the generated surface becomes a ceiling instead of a floor.
The lookup is scoped to this framework's handle, not RTLD_DEFAULT, so a symbol some other loaded image exports is not reported as this one's.
func TryClass_addIvar ¶
func TryClass_addIvar(cls objc.Class, name string, size uintptr, alignment uint8, types string) (bool, error)
TryClass_addIvar is like Class_addIvar but returns an error instead of panicking if class_addIvar is unavailable at run time.
func TryClass_addMethod ¶
TryClass_addMethod is like Class_addMethod but returns an error instead of panicking if class_addMethod is unavailable at run time.
func TryClass_addProperty ¶
func TryClass_addProperty(cls objc.Class, name string, attributes *Objc_property_attribute_t, attributeCount uint32) (bool, error)
TryClass_addProperty is like Class_addProperty but returns an error instead of panicking if class_addProperty is unavailable at run time.
func TryClass_addProtocol ¶
TryClass_addProtocol is like Class_addProtocol but returns an error instead of panicking if class_addProtocol is unavailable at run time.
func TryClass_conformsToProtocol ¶
TryClass_conformsToProtocol is like Class_conformsToProtocol but returns an error instead of panicking if class_conformsToProtocol is unavailable at run time.
func TryClass_getImageName ¶
TryClass_getImageName is like Class_getImageName but returns an error instead of panicking if class_getImageName is unavailable at run time.
func TryClass_getInstanceSize ¶
TryClass_getInstanceSize is like Class_getInstanceSize but returns an error instead of panicking if class_getInstanceSize is unavailable at run time.
func TryClass_getIvarLayout ¶
TryClass_getIvarLayout is like Class_getIvarLayout but returns an error instead of panicking if class_getIvarLayout is unavailable at run time.
func TryClass_getName ¶
TryClass_getName is like Class_getName but returns an error instead of panicking if class_getName is unavailable at run time.
func TryClass_getProperty ¶
TryClass_getProperty is like Class_getProperty but returns an error instead of panicking if class_getProperty is unavailable at run time.
func TryClass_getSuperclass ¶
TryClass_getSuperclass is like Class_getSuperclass but returns an error instead of panicking if class_getSuperclass is unavailable at run time.
func TryClass_getVersion ¶
TryClass_getVersion is like Class_getVersion but returns an error instead of panicking if class_getVersion is unavailable at run time.
func TryClass_getWeakIvarLayout ¶
TryClass_getWeakIvarLayout is like Class_getWeakIvarLayout but returns an error instead of panicking if class_getWeakIvarLayout is unavailable at run time.
func TryClass_isMetaClass ¶
TryClass_isMetaClass is like Class_isMetaClass but returns an error instead of panicking if class_isMetaClass is unavailable at run time.
func TryClass_replaceProperty ¶
func TryClass_replaceProperty(cls objc.Class, name string, attributes *Objc_property_attribute_t, attributeCount uint32) error
TryClass_replaceProperty is like Class_replaceProperty but returns an error instead of panicking if class_replaceProperty is unavailable at run time.
func TryClass_respondsToSelector ¶
TryClass_respondsToSelector is like Class_respondsToSelector but returns an error instead of panicking if class_respondsToSelector is unavailable at run time.
func TryClass_setIvarLayout ¶
TryClass_setIvarLayout is like Class_setIvarLayout but returns an error instead of panicking if class_setIvarLayout is unavailable at run time.
func TryClass_setVersion ¶
TryClass_setVersion is like Class_setVersion but returns an error instead of panicking if class_setVersion is unavailable at run time.
func TryClass_setWeakIvarLayout ¶
TryClass_setWeakIvarLayout is like Class_setWeakIvarLayout but returns an error instead of panicking if class_setWeakIvarLayout is unavailable at run time.
func TryImp_removeBlock ¶
TryImp_removeBlock is like Imp_removeBlock but returns an error instead of panicking if imp_removeBlock is unavailable at run time.
func TryIvar_getName ¶
TryIvar_getName is like Ivar_getName but returns an error instead of panicking if ivar_getName is unavailable at run time.
func TryIvar_getOffset ¶
TryIvar_getOffset is like Ivar_getOffset but returns an error instead of panicking if ivar_getOffset is unavailable at run time.
func TryIvar_getTypeEncoding ¶
TryIvar_getTypeEncoding is like Ivar_getTypeEncoding but returns an error instead of panicking if ivar_getTypeEncoding is unavailable at run time.
func TryMethod_copyArgumentType ¶
TryMethod_copyArgumentType is like Method_copyArgumentType but returns an error instead of panicking if method_copyArgumentType is unavailable at run time.
func TryMethod_copyReturnType ¶
TryMethod_copyReturnType is like Method_copyReturnType but returns an error instead of panicking if method_copyReturnType is unavailable at run time.
func TryMethod_exchangeImplementations ¶
TryMethod_exchangeImplementations is like Method_exchangeImplementations but returns an error instead of panicking if method_exchangeImplementations is unavailable at run time.
func TryMethod_getArgumentType ¶
TryMethod_getArgumentType is like Method_getArgumentType but returns an error instead of panicking if method_getArgumentType is unavailable at run time.
func TryMethod_getNumberOfArguments ¶
TryMethod_getNumberOfArguments is like Method_getNumberOfArguments but returns an error instead of panicking if method_getNumberOfArguments is unavailable at run time.
func TryMethod_getReturnType ¶
TryMethod_getReturnType is like Method_getReturnType but returns an error instead of panicking if method_getReturnType is unavailable at run time.
func TryMethod_getTypeEncoding ¶
TryMethod_getTypeEncoding is like Method_getTypeEncoding but returns an error instead of panicking if method_getTypeEncoding is unavailable at run time.
func TryMethod_invoke ¶
func TryMethod_invoke() error
TryMethod_invoke is like Method_invoke but returns an error instead of panicking if method_invoke is unavailable at run time.
func TryNXCompareHashTables ¶
func TryNXCompareHashTables(table1 *NXHashTable, table2 *NXHashTable) (bool, error)
TryNXCompareHashTables is like NXCompareHashTables but returns an error instead of panicking if NXCompareHashTables is unavailable at run time.
func TryNXCountHashTable ¶
func TryNXCountHashTable(table *NXHashTable) (uint32, error)
TryNXCountHashTable is like NXCountHashTable but returns an error instead of panicking if NXCountHashTable is unavailable at run time.
func TryNXEmptyHashTable ¶
func TryNXEmptyHashTable(table *NXHashTable) error
TryNXEmptyHashTable is like NXEmptyHashTable but returns an error instead of panicking if NXEmptyHashTable is unavailable at run time.
func TryNXFreeHashTable ¶
func TryNXFreeHashTable(table *NXHashTable) error
TryNXFreeHashTable is like NXFreeHashTable but returns an error instead of panicking if NXFreeHashTable is unavailable at run time.
func TryNXHashGet ¶
TryNXHashGet is like NXHashGet but returns an error instead of panicking if NXHashGet is unavailable at run time.
func TryNXHashInsert ¶
TryNXHashInsert is like NXHashInsert but returns an error instead of panicking if NXHashInsert is unavailable at run time.
func TryNXHashInsertIfAbsent ¶
TryNXHashInsertIfAbsent is like NXHashInsertIfAbsent but returns an error instead of panicking if NXHashInsertIfAbsent is unavailable at run time.
func TryNXHashMember ¶
func TryNXHashMember(table *NXHashTable, data unsafe.Pointer) (int32, error)
TryNXHashMember is like NXHashMember but returns an error instead of panicking if NXHashMember is unavailable at run time.
func TryNXHashRemove ¶
TryNXHashRemove is like NXHashRemove but returns an error instead of panicking if NXHashRemove is unavailable at run time.
func TryNXNextHashState ¶
func TryNXNextHashState(table *NXHashTable, state *NXHashState, data unsafe.Pointer) (int32, error)
TryNXNextHashState is like NXNextHashState but returns an error instead of panicking if NXNextHashState is unavailable at run time.
func TryNXNoEffectFree ¶
TryNXNoEffectFree is like NXNoEffectFree but returns an error instead of panicking if NXNoEffectFree is unavailable at run time.
func TryNXPtrHash ¶
TryNXPtrHash is like NXPtrHash but returns an error instead of panicking if NXPtrHash is unavailable at run time.
func TryNXPtrIsEqual ¶
func TryNXPtrIsEqual(info unsafe.Pointer, data1 unsafe.Pointer, data2 unsafe.Pointer) (int32, error)
TryNXPtrIsEqual is like NXPtrIsEqual but returns an error instead of panicking if NXPtrIsEqual is unavailable at run time.
func TryNXReallyFree ¶
TryNXReallyFree is like NXReallyFree but returns an error instead of panicking if NXReallyFree is unavailable at run time.
func TryNXResetHashTable ¶
func TryNXResetHashTable(table *NXHashTable) error
TryNXResetHashTable is like NXResetHashTable but returns an error instead of panicking if NXResetHashTable is unavailable at run time.
func TryNXStrHash ¶
TryNXStrHash is like NXStrHash but returns an error instead of panicking if NXStrHash is unavailable at run time.
func TryNXStrIsEqual ¶
func TryNXStrIsEqual(info unsafe.Pointer, data1 unsafe.Pointer, data2 unsafe.Pointer) (int32, error)
TryNXStrIsEqual is like NXStrIsEqual but returns an error instead of panicking if NXStrIsEqual is unavailable at run time.
func TryObjc_addExceptionHandler ¶
TryObjc_addExceptionHandler is like Objc_addExceptionHandler but returns an error instead of panicking if objc_addExceptionHandler is unavailable at run time.
func TryObjc_addLoadImageFunc ¶
TryObjc_addLoadImageFunc is like Objc_addLoadImageFunc but returns an error instead of panicking if objc_addLoadImageFunc is unavailable at run time.
func TryObjc_allocateClassPair ¶
func TryObjc_allocateClassPair(superclass objc.Class, name string, extraBytes uintptr) (objc.Class, error)
TryObjc_allocateClassPair is like Objc_allocateClassPair but returns an error instead of panicking if objc_allocateClassPair is unavailable at run time.
func TryObjc_copyClassList ¶
TryObjc_copyClassList is like Objc_copyClassList but returns an error instead of panicking if objc_copyClassList is unavailable at run time.
func TryObjc_copyClassNamesForImage ¶
TryObjc_copyClassNamesForImage is like Objc_copyClassNamesForImage but returns an error instead of panicking if objc_copyClassNamesForImage is unavailable at run time.
func TryObjc_copyImageNames ¶
TryObjc_copyImageNames is like Objc_copyImageNames but returns an error instead of panicking if objc_copyImageNames is unavailable at run time.
func TryObjc_destructInstance ¶
TryObjc_destructInstance is like Objc_destructInstance but returns an error instead of panicking if objc_destructInstance is unavailable at run time.
func TryObjc_disposeClassPair ¶
TryObjc_disposeClassPair is like Objc_disposeClassPair but returns an error instead of panicking if objc_disposeClassPair is unavailable at run time.
func TryObjc_duplicateClass ¶
func TryObjc_duplicateClass(original objc.Class, name string, extraBytes uintptr) (objc.Class, error)
TryObjc_duplicateClass is like Objc_duplicateClass but returns an error instead of panicking if objc_duplicateClass is unavailable at run time.
func TryObjc_end_catch ¶
func TryObjc_end_catch() error
TryObjc_end_catch is like Objc_end_catch but returns an error instead of panicking if objc_end_catch is unavailable at run time.
func TryObjc_enumerateClasses ¶
func TryObjc_enumerateClasses(image unsafe.Pointer, namePrefix string, conformingTo *Protocol, subclassing objc.Class, block func(uintptr, *bool)) error
TryObjc_enumerateClasses is like Objc_enumerateClasses but returns an error instead of panicking if objc_enumerateClasses is unavailable at run time.
func TryObjc_enumerationMutation ¶
TryObjc_enumerationMutation is like Objc_enumerationMutation but returns an error instead of panicking if objc_enumerationMutation is unavailable at run time.
func TryObjc_exception_rethrow ¶
func TryObjc_exception_rethrow() error
TryObjc_exception_rethrow is like Objc_exception_rethrow but returns an error instead of panicking if objc_exception_rethrow is unavailable at run time.
func TryObjc_exception_throw ¶
TryObjc_exception_throw is like Objc_exception_throw but returns an error instead of panicking if objc_exception_throw is unavailable at run time.
func TryObjc_getClassList ¶
TryObjc_getClassList is like Objc_getClassList but returns an error instead of panicking if objc_getClassList is unavailable at run time.
func TryObjc_getFutureClass ¶
TryObjc_getFutureClass is like Objc_getFutureClass but returns an error instead of panicking if objc_getFutureClass is unavailable at run time.
func TryObjc_getRequiredClass ¶
TryObjc_getRequiredClass is like Objc_getRequiredClass but returns an error instead of panicking if objc_getRequiredClass is unavailable at run time.
func TryObjc_lookUpClass ¶
TryObjc_lookUpClass is like Objc_lookUpClass but returns an error instead of panicking if objc_lookUpClass is unavailable at run time.
func TryObjc_msgSend ¶
func TryObjc_msgSend() error
TryObjc_msgSend is like Objc_msgSend but returns an error instead of panicking if objc_msgSend is unavailable at run time.
func TryObjc_msgSendSuper ¶
func TryObjc_msgSendSuper() error
TryObjc_msgSendSuper is like Objc_msgSendSuper but returns an error instead of panicking if objc_msgSendSuper is unavailable at run time.
func TryObjc_registerClassPair ¶
TryObjc_registerClassPair is like Objc_registerClassPair but returns an error instead of panicking if objc_registerClassPair is unavailable at run time.
func TryObjc_registerProtocol ¶
TryObjc_registerProtocol is like Objc_registerProtocol but returns an error instead of panicking if objc_registerProtocol is unavailable at run time.
func TryObjc_removeAssociatedObjects ¶
TryObjc_removeAssociatedObjects is like Objc_removeAssociatedObjects but returns an error instead of panicking if objc_removeAssociatedObjects is unavailable at run time.
func TryObjc_removeExceptionHandler ¶
TryObjc_removeExceptionHandler is like Objc_removeExceptionHandler but returns an error instead of panicking if objc_removeExceptionHandler is unavailable at run time.
func TryObjc_setAssociatedObject ¶
func TryObjc_setAssociatedObject(object Object, key unsafe.Pointer, value Object, policy Objc_AssociationPolicy) error
TryObjc_setAssociatedObject is like Objc_setAssociatedObject but returns an error instead of panicking if objc_setAssociatedObject is unavailable at run time.
func TryObjc_setEnumerationMutationHandler ¶
TryObjc_setEnumerationMutationHandler is like Objc_setEnumerationMutationHandler but returns an error instead of panicking if objc_setEnumerationMutationHandler is unavailable at run time.
func TryObjc_setExceptionMatcher ¶
TryObjc_setExceptionMatcher is like Objc_setExceptionMatcher but returns an error instead of panicking if objc_setExceptionMatcher is unavailable at run time.
func TryObjc_setExceptionPreprocessor ¶
TryObjc_setExceptionPreprocessor is like Objc_setExceptionPreprocessor but returns an error instead of panicking if objc_setExceptionPreprocessor is unavailable at run time.
func TryObjc_setForwardHandler ¶
TryObjc_setForwardHandler is like Objc_setForwardHandler but returns an error instead of panicking if objc_setForwardHandler is unavailable at run time.
func TryObjc_setHook_getClass ¶
func TryObjc_setHook_getClass(newValue unsafe.Pointer, outOldValue *Objc_hook_getClass) error
TryObjc_setHook_getClass is like Objc_setHook_getClass but returns an error instead of panicking if objc_setHook_getClass is unavailable at run time.
func TryObjc_setHook_getImageName ¶
func TryObjc_setHook_getImageName(newValue unsafe.Pointer, outOldValue *Objc_hook_getImageName) error
TryObjc_setHook_getImageName is like Objc_setHook_getImageName but returns an error instead of panicking if objc_setHook_getImageName is unavailable at run time.
func TryObjc_setHook_lazyClassNamer ¶
func TryObjc_setHook_lazyClassNamer(newValue unsafe.Pointer, oldOutValue *Objc_hook_lazyClassNamer) error
TryObjc_setHook_lazyClassNamer is like Objc_setHook_lazyClassNamer but returns an error instead of panicking if objc_setHook_lazyClassNamer is unavailable at run time.
func TryObjc_setUncaughtExceptionHandler ¶
TryObjc_setUncaughtExceptionHandler is like Objc_setUncaughtExceptionHandler but returns an error instead of panicking if objc_setUncaughtExceptionHandler is unavailable at run time.
func TryObjc_sync_enter ¶
TryObjc_sync_enter is like Objc_sync_enter but returns an error instead of panicking if objc_sync_enter is unavailable at run time.
func TryObjc_sync_exit ¶
TryObjc_sync_exit is like Objc_sync_exit but returns an error instead of panicking if objc_sync_exit is unavailable at run time.
func TryObjc_terminate ¶
func TryObjc_terminate() error
TryObjc_terminate is like Objc_terminate but returns an error instead of panicking if objc_terminate is unavailable at run time.
func TryObject_getClass ¶
TryObject_getClass is like Object_getClass but returns an error instead of panicking if object_getClass is unavailable at run time.
func TryObject_getClassName ¶
TryObject_getClassName is like Object_getClassName but returns an error instead of panicking if object_getClassName is unavailable at run time.
func TryObject_getIndexedIvars ¶
TryObject_getIndexedIvars is like Object_getIndexedIvars but returns an error instead of panicking if object_getIndexedIvars is unavailable at run time.
func TryObject_isClass ¶
TryObject_isClass is like Object_isClass but returns an error instead of panicking if object_isClass is unavailable at run time.
func TryObject_setClass ¶
TryObject_setClass is like Object_setClass but returns an error instead of panicking if object_setClass is unavailable at run time.
func TryObject_setIvar ¶
TryObject_setIvar is like Object_setIvar but returns an error instead of panicking if object_setIvar is unavailable at run time.
func TryObject_setIvarWithStrongDefault ¶
TryObject_setIvarWithStrongDefault is like Object_setIvarWithStrongDefault but returns an error instead of panicking if object_setIvarWithStrongDefault is unavailable at run time.
func TryProperty_copyAttributeValue ¶
TryProperty_copyAttributeValue is like Property_copyAttributeValue but returns an error instead of panicking if property_copyAttributeValue is unavailable at run time.
func TryProperty_getAttributes ¶
TryProperty_getAttributes is like Property_getAttributes but returns an error instead of panicking if property_getAttributes is unavailable at run time.
func TryProperty_getName ¶
TryProperty_getName is like Property_getName but returns an error instead of panicking if property_getName is unavailable at run time.
func TryProtocol_addMethodDescription ¶
func TryProtocol_addMethodDescription(proto *Protocol, name SEL, types string, isRequiredMethod bool, isInstanceMethod bool) error
TryProtocol_addMethodDescription is like Protocol_addMethodDescription but returns an error instead of panicking if protocol_addMethodDescription is unavailable at run time.
func TryProtocol_addProperty ¶
func TryProtocol_addProperty(proto *Protocol, name string, attributes *Objc_property_attribute_t, attributeCount uint32, isRequiredProperty bool, isInstanceProperty bool) error
TryProtocol_addProperty is like Protocol_addProperty but returns an error instead of panicking if protocol_addProperty is unavailable at run time.
func TryProtocol_addProtocol ¶
TryProtocol_addProtocol is like Protocol_addProtocol but returns an error instead of panicking if protocol_addProtocol is unavailable at run time.
func TryProtocol_conformsToProtocol ¶
TryProtocol_conformsToProtocol is like Protocol_conformsToProtocol but returns an error instead of panicking if protocol_conformsToProtocol is unavailable at run time.
func TryProtocol_getName ¶
TryProtocol_getName is like Protocol_getName but returns an error instead of panicking if protocol_getName is unavailable at run time.
func TryProtocol_getProperty ¶
func TryProtocol_getProperty(proto *Protocol, name string, isRequiredProperty bool, isInstanceProperty bool) (unsafe.Pointer, error)
TryProtocol_getProperty is like Protocol_getProperty but returns an error instead of panicking if protocol_getProperty is unavailable at run time.
func TryProtocol_isEqual ¶
TryProtocol_isEqual is like Protocol_isEqual but returns an error instead of panicking if protocol_isEqual is unavailable at run time.
func TrySel_getName ¶
TrySel_getName is like Sel_getName but returns an error instead of panicking if sel_getName is unavailable at run time.
func TrySel_isEqual ¶
TrySel_isEqual is like Sel_isEqual but returns an error instead of panicking if sel_isEqual is unavailable at run time.
func TrySel_isMapped ¶
TrySel_isMapped is like Sel_isMapped but returns an error instead of panicking if sel_isMapped is unavailable at run time.
Types ¶
type BOOL ¶
type BOOL = bool
BOOL is type to represent a Boolean value.
See: https://developer.apple.com/documentation/ObjectiveC/BOOL
type Category ¶
type Category = uintptr
Category is an opaque type that represents a category.
See: https://developer.apple.com/documentation/ObjectiveC/Category
type Class ¶
Class is an opaque type that represents an Objective-C class.
See: https://developer.apple.com/documentation/ObjectiveC/Class
type IMP ¶
type IMP = func()
IMP is a pointer to the start of a method implementation.
See: https://developer.apple.com/documentation/ObjectiveC/IMP
func Class_getMethodImplementation ¶
Class_getMethodImplementation returns the function pointer that would be called if a particular message were sent to an instance of a class.
It panics if class_getMethodImplementation is unavailable at run time; use TryClass_getMethodImplementation to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/class_getMethodImplementation(_:_:)
func Class_replaceMethod ¶
Class_replaceMethod replaces the implementation of a method for a given class.
It panics if class_replaceMethod is unavailable at run time; use TryClass_replaceMethod to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/class_replaceMethod(_:_:_:_:)
func Imp_implementationWithBlock ¶
Imp_implementationWithBlock creates a pointer to a function that calls the specified block when the method is called.
It panics if imp_implementationWithBlock is unavailable at run time; use TryImp_implementationWithBlock to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/imp_implementationWithBlock(_:)
func Method_getImplementation ¶
Method_getImplementation returns the implementation of a method.
It panics if method_getImplementation is unavailable at run time; use TryMethod_getImplementation to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/method_getImplementation(_:)
func Method_setImplementation ¶
Method_setImplementation sets the implementation of a method.
It panics if method_setImplementation is unavailable at run time; use TryMethod_setImplementation to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/method_setImplementation(_:_:)
func TryClass_getMethodImplementation ¶
TryClass_getMethodImplementation is like Class_getMethodImplementation but returns an error instead of panicking if class_getMethodImplementation is unavailable at run time.
func TryClass_replaceMethod ¶
TryClass_replaceMethod is like Class_replaceMethod but returns an error instead of panicking if class_replaceMethod is unavailable at run time.
func TryImp_implementationWithBlock ¶
TryImp_implementationWithBlock is like Imp_implementationWithBlock but returns an error instead of panicking if imp_implementationWithBlock is unavailable at run time.
func TryMethod_getImplementation ¶
TryMethod_getImplementation is like Method_getImplementation but returns an error instead of panicking if method_getImplementation is unavailable at run time.
func TryMethod_setImplementation ¶
TryMethod_setImplementation is like Method_setImplementation but returns an error instead of panicking if method_setImplementation is unavailable at run time.
type IProtocol ¶
type IProtocol interface {
IObject
}
An interface definition for the Protocol class.
See: https://developer.apple.com/documentation/ObjectiveC/Protocol
type Id ¶
type Id = Object
Id is a pointer to an instance of a class.
See: https://developer.apple.com/documentation/ObjectiveC/id
type Ivar ¶
type Ivar = uintptr
Ivar is an opaque type that represents an instance variable.
See: https://developer.apple.com/documentation/ObjectiveC/Ivar
func Class_copyIvarList ¶
Class_copyIvarList describes the instance variables declared by a class.
It panics if class_copyIvarList is unavailable at run time; use TryClass_copyIvarList to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/class_copyIvarList(_:_:)
func Class_getClassVariable ¶
Class_getClassVariable returns the Ivar for a specified class variable of a given class.
It panics if class_getClassVariable is unavailable at run time; use TryClass_getClassVariable to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/class_getClassVariable(_:_:)
func Class_getInstanceVariable ¶
Class_getInstanceVariable returns the Ivar for a specified instance variable of a given class.
It panics if class_getInstanceVariable is unavailable at run time; use TryClass_getInstanceVariable to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/class_getInstanceVariable(_:_:)
func Object_getInstanceVariable ¶
Object_getInstanceVariable obtains the value of an instance variable of a class instance.
It panics if object_getInstanceVariable is unavailable at run time; use TryObject_getInstanceVariable to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/object_getInstanceVariable
func Object_setInstanceVariable ¶
Object_setInstanceVariable changes the value of an instance variable of a class instance.
It panics if object_setInstanceVariable is unavailable at run time; use TryObject_setInstanceVariable to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/object_setInstanceVariable
func Object_setInstanceVariableWithStrongDefault ¶
func Object_setInstanceVariableWithStrongDefault(obj Object, name string, value unsafe.Pointer) Ivar
Object_setInstanceVariableWithStrongDefault.
It panics if object_setInstanceVariableWithStrongDefault is unavailable at run time; use TryObject_setInstanceVariableWithStrongDefault to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/object_setInstanceVariableWithStrongDefault
func TryClass_copyIvarList ¶
TryClass_copyIvarList is like Class_copyIvarList but returns an error instead of panicking if class_copyIvarList is unavailable at run time.
func TryClass_getClassVariable ¶
TryClass_getClassVariable is like Class_getClassVariable but returns an error instead of panicking if class_getClassVariable is unavailable at run time.
func TryClass_getInstanceVariable ¶
TryClass_getInstanceVariable is like Class_getInstanceVariable but returns an error instead of panicking if class_getInstanceVariable is unavailable at run time.
func TryObject_getInstanceVariable ¶
TryObject_getInstanceVariable is like Object_getInstanceVariable but returns an error instead of panicking if object_getInstanceVariable is unavailable at run time.
func TryObject_setInstanceVariable ¶
TryObject_setInstanceVariable is like Object_setInstanceVariable but returns an error instead of panicking if object_setInstanceVariable is unavailable at run time.
func TryObject_setInstanceVariableWithStrongDefault ¶
func TryObject_setInstanceVariableWithStrongDefault(obj Object, name string, value unsafe.Pointer) (Ivar, error)
TryObject_setInstanceVariableWithStrongDefault is like Object_setInstanceVariableWithStrongDefault but returns an error instead of panicking if object_setInstanceVariableWithStrongDefault is unavailable at run time.
type Method ¶
type Method = uintptr
Method is an opaque type that represents a method in a class definition.
See: https://developer.apple.com/documentation/ObjectiveC/Method
func Class_copyMethodList ¶
Class_copyMethodList describes the instance methods implemented by a class.
It panics if class_copyMethodList is unavailable at run time; use TryClass_copyMethodList to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/class_copyMethodList(_:_:)
func Class_getClassMethod ¶
Class_getClassMethod returns a pointer to the data structure describing a given class method for a given class.
It panics if class_getClassMethod is unavailable at run time; use TryClass_getClassMethod to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/class_getClassMethod(_:_:)
func Class_getInstanceMethod ¶
Class_getInstanceMethod returns a specified instance method for a given class.
It panics if class_getInstanceMethod is unavailable at run time; use TryClass_getInstanceMethod to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/class_getInstanceMethod(_:_:)
func TryClass_copyMethodList ¶
TryClass_copyMethodList is like Class_copyMethodList but returns an error instead of panicking if class_copyMethodList is unavailable at run time.
func TryClass_getClassMethod ¶
TryClass_getClassMethod is like Class_getClassMethod but returns an error instead of panicking if class_getClassMethod is unavailable at run time.
func TryClass_getInstanceMethod ¶
TryClass_getInstanceMethod is like Class_getInstanceMethod but returns an error instead of panicking if class_getInstanceMethod is unavailable at run time.
type NSInteger ¶
type NSInteger = int
NSInteger is describes an integer.
See: https://developer.apple.com/documentation/ObjectiveC/NSInteger
type NSObject ¶
type NSObject interface {
// Returns a Boolean value that indicates whether the receiver and a given object are equal.
//
// See: https://developer.apple.com/documentation/ObjectiveC/NSObjectProtocol/isEqual(_:)
IsEqual(object IObject) bool
// Returns the receiver.
//
// See: https://developer.apple.com/documentation/ObjectiveC/NSObjectProtocol/self()
Self() objc.ID
// Returns a Boolean value that indicates whether the receiver is an instance of given class or an instance of any class that inherits from that class.
//
// See: https://developer.apple.com/documentation/ObjectiveC/NSObjectProtocol/isKind(of:)
IsKindOfClass(aClass Class) bool
// Returns a Boolean value that indicates whether the receiver is an instance of a given class.
//
// See: https://developer.apple.com/documentation/ObjectiveC/NSObjectProtocol/isMember(of:)
IsMemberOfClass(aClass Class) bool
// Returns a Boolean value that indicates whether the receiver implements or inherits a method that can respond to a specified message.
//
// See: https://developer.apple.com/documentation/ObjectiveC/NSObjectProtocol/responds(to:)
RespondsToSelector(aSelector SEL) bool
// Returns a Boolean value that indicates whether the receiver conforms to a given protocol.
//
// See: https://developer.apple.com/documentation/ObjectiveC/NSObjectProtocol/conforms(to:)
ConformsToProtocol(aProtocol *Protocol) bool
// Sends a specified message to the receiver and returns the result of the message.
//
// See: https://developer.apple.com/documentation/ObjectiveC/NSObjectProtocol/perform(_:)
PerformSelector(aSelector SEL) IObject
// Sends a message to the receiver with an object as the argument.
//
// See: https://developer.apple.com/documentation/ObjectiveC/NSObjectProtocol/perform(_:with:)
PerformSelectorWithObject(aSelector SEL, object IObject) IObject
// Sends a message to the receiver with two objects as arguments.
//
// See: https://developer.apple.com/documentation/ObjectiveC/NSObjectProtocol/perform(_:with:with:)
PerformSelectorWithObjectWithObject(aSelector SEL, object1 IObject, object2 IObject) IObject
// Returns a Boolean value that indicates whether the receiver does not descend from [NSObject](<https://developer.apple.com/documentation/ObjectiveC/NSObject-swift.class>).
//
// See: https://developer.apple.com/documentation/ObjectiveC/NSObjectProtocol/isProxy()
IsProxy() bool
// Returns the class object for the receiver’s class.
//
// See: https://developer.apple.com/documentation/ObjectiveC/NSObject-c.protocol/class
Class() objc.Class
// Decrements the receiver’s reference count.
//
// See: https://developer.apple.com/documentation/ObjectiveC/NSObject-c.protocol/release
Release()
// Increments the receiver’s reference count.
//
// See: https://developer.apple.com/documentation/ObjectiveC/NSObject-c.protocol/retain
Retain() objc.ID
// Do not use this method.
//
// See: https://developer.apple.com/documentation/ObjectiveC/NSObject-c.protocol/retainCount
RetainCount() uint
// Returns the class object for the receiver’s superclass.
//
// See: https://developer.apple.com/documentation/ObjectiveC/NSObjectProtocol/superclass
Superclass() objc.Class
// Returns an integer that can be used as a table address in a hash table structure.
//
// See: https://developer.apple.com/documentation/ObjectiveC/NSObjectProtocol/hash
Hash() uint
// A textual representation of the receiver.
//
// See: https://developer.apple.com/documentation/ObjectiveC/NSObjectProtocol/description
Description() IObject
// A textual representation of the receiver to use with a debugger.
//
// See: https://developer.apple.com/documentation/ObjectiveC/NSObjectProtocol/debugDescription
DebugDescription() IObject
}
The group of methods that are fundamental to all Objective-C objects.
See: https://developer.apple.com/documentation/ObjectiveC/NSObjectProtocol
type NSObjectObject ¶
type NSObjectObject struct {
Object
}
NSObjectObject wraps an existing Objective-C object that conforms to the NSObject protocol.
func NSObjectObjectFromID ¶
func NSObjectObjectFromID(id objc.ID) NSObjectObject
NSObjectObjectFromID constructs a NSObjectObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (NSObjectObject) BaseObject ¶
func (o NSObjectObject) BaseObject() Object
func (NSObjectObject) Class ¶ added in v0.5.1
func (o NSObjectObject) Class() objc.Class
Returns the class object for the receiver’s class.
Return Value ¶
The class object for the receiver’s class.
See: https://developer.apple.com/documentation/ObjectiveC/NSObject-c.protocol/class
func (NSObjectObject) ConformsToProtocol ¶
func (o NSObjectObject) ConformsToProtocol(aProtocol *Protocol) bool
Returns a Boolean value that indicates whether the receiver conforms to a given protocol.
aProtocol: A protocol object that represents a particular protocol.
Return Value ¶
YES if the receiver conforms to `aProtocol`, otherwise NO.
Discussion ¶
This method works identically to the conforms(to:) class method declared in NSObject. It’s provided as a convenience so that you don’t need to get the class object to find out whether an instance can respond to a given set of messages.
See: https://developer.apple.com/documentation/ObjectiveC/NSObjectProtocol/conforms(to:)
func (NSObjectObject) DebugDescription ¶
func (o NSObjectObject) DebugDescription() IObject
A textual representation of the receiver to use with a debugger.
Return Value ¶
A string that describes the object for debugging purposes.
Discussion ¶
The debugger’s `po` command uses this property to create a textual representation of the object suitable for display in the debugger. The default implemention returns the same value as [Description]. Override either property to provide custom object descriptions.
See: https://developer.apple.com/documentation/ObjectiveC/NSObjectProtocol/debugDescription
func (NSObjectObject) Description ¶
func (o NSObjectObject) Description() IObject
A textual representation of the receiver.
Return Value ¶
A string that describes the object.
See: https://developer.apple.com/documentation/ObjectiveC/NSObjectProtocol/description
func (NSObjectObject) Hash ¶
func (o NSObjectObject) Hash() uint
Returns an integer that can be used as a table address in a hash table structure.
Return Value ¶
An integer that can be used as a table address in a hash table structure.
Discussion ¶
If two objects are equal (as determined by the [IsEqual] method), they must have the same hash value. This last point is particularly important if you define [Hash] in a subclass and intend to put instances of that subclass into a collection.
If a mutable object is added to a collection that uses hash values to determine the object’s position in the collection, the value returned by the [Hash] method of the object must not change while the object is in the collection. Therefore, either the [Hash] method must not rely on any of the object’s internal state information or you must make sure the object’s internal state information does not change while the object is in the collection. Thus, for example, a mutable dictionary can be put in a hash table but you must not change it while it is in there. (Note that it can be difficult to know whether or not a given object is in a collection.)
See: https://developer.apple.com/documentation/ObjectiveC/NSObjectProtocol/hash
func (NSObjectObject) IsEqual ¶
func (o NSObjectObject) IsEqual(object IObject) bool
Returns a Boolean value that indicates whether the receiver and a given object are equal.
object: The object to be compared to the receiver. May be `nil`, in which case this method returns NO.
Return Value ¶
YES if the receiver and `anObject` are equal, otherwise NO.
Discussion ¶
This method defines what it means for instances to be equal. For example, a container object might define two containers as equal if their corresponding objects all respond YES to an [IsEqual] request. See the NSData, NSDictionary, NSArray, and NSString class specifications for examples of the use of this method.
If two objects are equal, they must have the same hash value. This last point is particularly important if you define [IsEqual] in a subclass and intend to put instances of that subclass into a collection. Make sure you also define [Hash] in your subclass.
See: https://developer.apple.com/documentation/ObjectiveC/NSObjectProtocol/isEqual(_:)
func (NSObjectObject) IsKindOfClass ¶
func (o NSObjectObject) IsKindOfClass(aClass Class) bool
Returns a Boolean value that indicates whether the receiver is an instance of given class or an instance of any class that inherits from that class.
aClass: A class object representing the Objective-C class to be tested.
Return Value ¶
YES if the receiver is an instance of `aClass` or an instance of any class that inherits from `aClass`, otherwise NO.
Discussion ¶
For example, in this code, [IsKindOfClass] would return YES because, in Foundation, the NSArchiver class inherits from NSCoder:
Be careful when using this method on objects represented by a class cluster. Because of the nature of class clusters, the object you get back may not always be the type you expected. If you call a method that returns a class cluster, the exact type returned by the method is the best indicator of what you can do with that object. For example, if a method returns a pointer to an NSArray object, you should not use this method to see if the array is mutable, as shown in the following code:
If you use such constructs in your code, you might think it is alright to modify an object that in reality should not be modified. Doing so might then create problems for other code that expected the object to remain unchanged.
If the receiver is a class object, this method returns YES if `aClass` is a Class object of the same type, NO otherwise.
See: https://developer.apple.com/documentation/ObjectiveC/NSObjectProtocol/isKind(of:)
func (NSObjectObject) IsMemberOfClass ¶
func (o NSObjectObject) IsMemberOfClass(aClass Class) bool
Returns a Boolean value that indicates whether the receiver is an instance of a given class.
aClass: A class object representing the Objective-C class to be tested.
Return Value ¶
YES if the receiver is an instance of `aClass`, otherwise NO.
Discussion ¶
For example, in this code, [IsMemberOfClass] would return NO:
Class objects may be compiler-created objects but they still support the concept of membership. Thus, you can use this method to verify that the receiver is a specific Class object.
See: https://developer.apple.com/documentation/ObjectiveC/NSObjectProtocol/isMember(of:)
func (NSObjectObject) IsProxy ¶
func (o NSObjectObject) IsProxy() bool
Returns a Boolean value that indicates whether the receiver does not descend from NSObject.
Return Value ¶
NO if the receiver really descends from NSObject, otherwise YES.
Discussion ¶
This method is necessary because sending [IsKindOfClass] or [IsMemberOfClass] to an NSProxy object will test the object the proxy stands in for, not the proxy itself. Use this method to test if the receiver is a proxy (or a member of some other root class).
See: https://developer.apple.com/documentation/ObjectiveC/NSObjectProtocol/isProxy()
func (NSObjectObject) PerformSelector ¶
func (o NSObjectObject) PerformSelector(aSelector SEL) IObject
Sends a specified message to the receiver and returns the result of the message.
aSelector: A selector identifying the message to send. The message should take no arguments. If `aSelector` is [NULL], an invalidArgumentException is raised.
Return Value ¶
An object that is the result of the message.
Discussion ¶
Calling the [PerformSelector] method is equivalent to sending the `aSelector` message directly to the receiver. For example, the following both do the same thing if `anObject` is an instance of [MyObject]:
The [PerformSelector] method allows you to send messages that aren’t determined until run-time. This means that you can pass a variable selector as the argument:
Use caution when doing this. This method returns an implicitly unwrapped optional unmanaged pointer to an AnyObject instance (Unmanaged`!`). It’s up to you to decide how to bring the instance into Swift’s memory management scheme. Different messages require different memory management strategies for their returned objects, and it might not be obvious which to use.
Usually, a caller isn’t responsible for the memory of a returned instance, in which case you use takeUnretainedValue(), as shown above. However, for any of the creation methods, such as copy(), the caller is responsible, and you use takeRetainedValue() instead. See Memory Management Policy in Advanced Memory Management Programming Guide for a description of ownership expectations.
Due to this uncertainty, the compiler generates a warning if you supply a variable selector while using ARC to manage memory. Because it can’t determine ownership of the returned object at compile-time, ARC makes the assumption that the caller does not need to take ownership, but this may not be true. The compiler warning alerts you to the potential for a memory leak.
To avoid the warning, if you know that `aSelector` has no return value, you might be able to use performSelector(onMainThread:with:waitUntilDone:) or one of the related methods available in NSObject.
For a more general solution, use NSInvocation to construct a message that you can invoke with an arbitrary argument list and return value.
Alternatively, consider restructuring your code to use blocks as a means of passing chunks of functionality through an API. See Blocks Programming Topics for details.
See: https://developer.apple.com/documentation/ObjectiveC/NSObjectProtocol/perform(_:)
func (NSObjectObject) PerformSelectorWithObject ¶
func (o NSObjectObject) PerformSelectorWithObject(aSelector SEL, object IObject) IObject
Sends a message to the receiver with an object as the argument.
aSelector: A selector identifying the message to send. If `aSelector` is [NULL], an invalidArgumentException is raised.
object: An object that is the sole argument of the message.
Return Value ¶
An object that is the result of the message.
Discussion ¶
This method is the same as [PerformSelector] except that you can supply an argument for `aSelector`. `aSelector` should identify a method that takes a single argument of type id. For methods with other argument types and return values, use NSInvocation.
See: https://developer.apple.com/documentation/ObjectiveC/NSObjectProtocol/perform(_:with:)
func (NSObjectObject) PerformSelectorWithObjectWithObject ¶
func (o NSObjectObject) PerformSelectorWithObjectWithObject(aSelector SEL, object1 IObject, object2 IObject) IObject
Sends a message to the receiver with two objects as arguments.
aSelector: A selector identifying the message to send. If `aSelector` is [NULL], an invalidArgumentException is raised.
object1: An object that is the first argument of the message.
object2: An object that is the second argument of the message
Return Value ¶
An object that is the result of the message.
Discussion ¶
This method is the same as [PerformSelector] except that you can supply two arguments for `aSelector`. `aSelector` should identify a method that can take two arguments of type id. For methods with other argument types and return values, use NSInvocation.
See: https://developer.apple.com/documentation/ObjectiveC/NSObjectProtocol/perform(_:with:with:)
func (NSObjectObject) Release ¶
func (o NSObjectObject) Release()
Decrements the receiver’s reference count.
Discussion ¶
The receiver is sent a dealloc message when its reference count reaches `0`.
You would only implement this method to define your own reference-counting scheme. Such implementations should not invoke the inherited method; that is, they should not include a release message to `super`.
For more information on the reference counting mechanism, see Advanced Memory Management Programming Guide.
Special Considerations ¶
Instead of using manual reference counting, you should adopt ARC—see Transitioning to ARC Release Notes.
See: https://developer.apple.com/documentation/ObjectiveC/NSObject-c.protocol/release
func (NSObjectObject) RespondsToSelector ¶
func (o NSObjectObject) RespondsToSelector(aSelector SEL) bool
Returns a Boolean value that indicates whether the receiver implements or inherits a method that can respond to a specified message.
aSelector: A selector that identifies a message.
Return Value ¶
YES if the receiver implements or inherits a method that can respond to `aSelector`, otherwise NO.
Discussion ¶
The application is responsible for determining whether a NO response should be considered an error.
You cannot test whether an object inherits a method from its superclass by sending [RespondsToSelector] to the object using the `super` keyword. This method will still be testing the object as a whole, not just the superclass’s implementation. Therefore, sending [RespondsToSelector] to `super` is equivalent to sending it to `self`. Instead, you must invoke the NSObject class method instancesRespond(to:) directly on the object’s superclass, as illustrated in the following code fragment.
You cannot simply use `[[self superclass] @selector(aMethod)]` since this may cause the method to fail if it is invoked by a subclass.
Note that if the receiver is able to forward `aSelector` messages to another object, it will be able to respond to the message, albeit indirectly, even though this method returns NO.
See: https://developer.apple.com/documentation/ObjectiveC/NSObjectProtocol/responds(to:)
func (NSObjectObject) Retain ¶
func (o NSObjectObject) Retain() objc.ID
Increments the receiver’s reference count.
Return Value ¶
`self`.
Discussion ¶
You send an object a [Retain] message when you want to prevent it from being deallocated until you have finished using it.
An object is deallocated automatically when its reference count reaches `0`. [Retain] messages increment the reference count, and [Release] messages decrement it. For more information on this mechanism, see Advanced Memory Management Programming Guide.
As a convenience, [Retain] returns `self` because it may be used in nested expressions.
You would implement this method only if you were defining your own reference-counting scheme. Such implementations must return `self` and should not invoke the inherited method by sending a [Retain] message to `super`.
Special Considerations ¶
Instead of using manual reference counting, you should adopt ARC—see Transitioning to ARC Release Notes.
See: https://developer.apple.com/documentation/ObjectiveC/NSObject-c.protocol/retain
func (NSObjectObject) RetainCount ¶ added in v0.5.1
func (o NSObjectObject) RetainCount() uint
Do not use this method.
Return Value ¶
The receiver’s reference count.
Discussion ¶
This method is of no value in debugging memory management issues. Because any number of framework objects may have retained an object in order to hold references to it, while at the same time autorelease pools may be holding any number of deferred releases on an object, it is very unlikely that you can get useful information from this method.
To understand the fundamental rules of memory management that you must abide by, read Memory Management Policy. To diagnose memory management problems, use a suitable tool:
- The Clang Static analyzer can typically find memory management problems even before you run your program. - The Object Alloc instrument in the Instruments application (see Instruments User Guide) can track object allocation and destruction.
See: https://developer.apple.com/documentation/ObjectiveC/NSObject-c.protocol/retainCount
func (NSObjectObject) Self ¶
func (o NSObjectObject) Self() objc.ID
Returns the receiver.
Return Value ¶
The receiver.
See: https://developer.apple.com/documentation/ObjectiveC/NSObjectProtocol/self()
func (NSObjectObject) Superclass ¶
func (o NSObjectObject) Superclass() objc.Class
Returns the class object for the receiver’s superclass.
Return Value ¶
The class object for the receiver’s superclass.
See: https://developer.apple.com/documentation/ObjectiveC/NSObjectProtocol/superclass
type NSUInteger ¶
type NSUInteger = uint
NSUInteger is describes an unsigned integer.
See: https://developer.apple.com/documentation/ObjectiveC/NSUInteger
type NXHashState ¶
NXHashState
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/ObjectiveC/NXHashState
func NXInitHashState
deprecated
func NXInitHashState(table *NXHashTable) NXHashState
NXInitHashState.
It panics if NXInitHashState is unavailable at run time; use TryNXInitHashState to get an error instead.
Deprecated: Deprecated since macOS 10.1.
See: https://developer.apple.com/documentation/ObjectiveC/NXInitHashState
func TryNXInitHashState ¶
func TryNXInitHashState(table *NXHashTable) (NXHashState, error)
TryNXInitHashState is like NXInitHashState but returns an error instead of panicking if NXInitHashState is unavailable at run time.
type NXHashTable ¶
type NXHashTable struct {
Prototype *NXHashTablePrototype
Count uint32
NbBuckets uint32
Buckets unsafe.Pointer
Info unsafe.Pointer
}
NXHashTable
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/ObjectiveC/NXHashTable
func NXCopyHashTable
deprecated
func NXCopyHashTable(table *NXHashTable) *NXHashTable
NXCopyHashTable.
It panics if NXCopyHashTable is unavailable at run time; use TryNXCopyHashTable to get an error instead.
Deprecated: Deprecated since macOS 10.1.
See: https://developer.apple.com/documentation/ObjectiveC/NXCopyHashTable
func NXCreateHashTable
deprecated
func NXCreateHashTable(prototype NXHashTablePrototype, capacity uint32, info unsafe.Pointer) *NXHashTable
NXCreateHashTable.
It panics if NXCreateHashTable is unavailable at run time; use TryNXCreateHashTable to get an error instead.
Deprecated: Deprecated since macOS 10.1.
See: https://developer.apple.com/documentation/ObjectiveC/NXCreateHashTable
func NXCreateHashTableFromZone
deprecated
func NXCreateHashTableFromZone(prototype NXHashTablePrototype, capacity uint32, info unsafe.Pointer, zone unsafe.Pointer) *NXHashTable
NXCreateHashTableFromZone.
It panics if NXCreateHashTableFromZone is unavailable at run time; use TryNXCreateHashTableFromZone to get an error instead.
Deprecated: Deprecated since macOS 10.1.
See: https://developer.apple.com/documentation/ObjectiveC/NXCreateHashTableFromZone
func TryNXCopyHashTable ¶
func TryNXCopyHashTable(table *NXHashTable) (*NXHashTable, error)
TryNXCopyHashTable is like NXCopyHashTable but returns an error instead of panicking if NXCopyHashTable is unavailable at run time.
func TryNXCreateHashTable ¶
func TryNXCreateHashTable(prototype NXHashTablePrototype, capacity uint32, info unsafe.Pointer) (*NXHashTable, error)
TryNXCreateHashTable is like NXCreateHashTable but returns an error instead of panicking if NXCreateHashTable is unavailable at run time.
func TryNXCreateHashTableFromZone ¶
func TryNXCreateHashTableFromZone(prototype NXHashTablePrototype, capacity uint32, info unsafe.Pointer, zone unsafe.Pointer) (*NXHashTable, error)
TryNXCreateHashTableFromZone is like NXCreateHashTableFromZone but returns an error instead of panicking if NXCreateHashTableFromZone is unavailable at run time.
type NXHashTablePrototype ¶
type NXHashTablePrototype struct {
// C: unsigned long (*)(const void *, const void *)
Hash uintptr
// C: int (*)(const void *, const void *, const void *)
IsEqual uintptr
// C: void (*)(const void *, void *)
Free uintptr
Style int32
}
NXHashTablePrototype
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/ObjectiveC/NXHashTablePrototype
var ( // // Deprecated: Deprecated since macOS 10.1. // // See: https://developer.apple.com/documentation/ObjectiveC/NXPtrPrototype NXPtrPrototype NXHashTablePrototype // // Deprecated: Deprecated since macOS 10.1. // // See: https://developer.apple.com/documentation/ObjectiveC/NXPtrStructKeyPrototype NXPtrStructKeyPrototype NXHashTablePrototype // // Deprecated: Deprecated since macOS 10.1. // // See: https://developer.apple.com/documentation/ObjectiveC/NXStrPrototype NXStrPrototype NXHashTablePrototype // // Deprecated: Deprecated since macOS 10.1. // // See: https://developer.apple.com/documentation/ObjectiveC/NXStrStructKeyPrototype NXStrStructKeyPrototype NXHashTablePrototype )
type ObjCClearResident ¶ added in v0.5.1
type ObjCClearResident uint32
const (
OBJC_CLEAR_RESIDENT_STACK ObjCClearResident = 1
)
func (ObjCClearResident) String ¶ added in v0.5.1
func (e ObjCClearResident) String() string
type ObjcAssociationPolicy ¶ added in v0.6.4
type ObjcAssociationPolicy = Objc_AssociationPolicy
ObjcAssociationPolicy is a Go-name alias for Objc_AssociationPolicy.
type ObjcExceptionHandler ¶ added in v0.6.4
type ObjcExceptionHandler = Objc_exception_handler
ObjcExceptionHandler is a Go-name alias for Objc_exception_handler.
type ObjcExceptionMatcher ¶ added in v0.6.4
type ObjcExceptionMatcher = Objc_exception_matcher
ObjcExceptionMatcher is a Go-name alias for Objc_exception_matcher.
type ObjcExceptionPreprocessor ¶ added in v0.6.4
type ObjcExceptionPreprocessor = Objc_exception_preprocessor
ObjcExceptionPreprocessor is a Go-name alias for Objc_exception_preprocessor.
type ObjcFuncLoadImage ¶ added in v0.6.4
type ObjcFuncLoadImage = Objc_func_loadImage
ObjcFuncLoadImage is a Go-name alias for Objc_func_loadImage.
type ObjcHookGetClass ¶ added in v0.6.4
type ObjcHookGetClass = Objc_hook_getClass
ObjcHookGetClass is a Go-name alias for Objc_hook_getClass.
type ObjcHookGetImageName ¶ added in v0.6.4
type ObjcHookGetImageName = Objc_hook_getImageName
ObjcHookGetImageName is a Go-name alias for Objc_hook_getImageName.
type ObjcHookLazyClassNamer ¶ added in v0.6.4
type ObjcHookLazyClassNamer = Objc_hook_lazyClassNamer
ObjcHookLazyClassNamer is a Go-name alias for Objc_hook_lazyClassNamer.
type ObjcObjectptr ¶ added in v0.6.4
type ObjcObjectptr = Objc_objectptr_t
ObjcObjectptr is a Go-name alias for Objc_objectptr_t.
type ObjcProperty ¶ added in v0.6.4
type ObjcProperty = Objc_property_t
ObjcProperty is a Go-name alias for Objc_property_t.
type ObjcUncaughtExceptionHandler ¶ added in v0.6.4
type ObjcUncaughtExceptionHandler = Objc_uncaught_exception_handler
ObjcUncaughtExceptionHandler is a Go-name alias for Objc_uncaught_exception_handler.
type ObjcZone ¶ added in v0.6.4
type ObjcZone = Objc_zone_t
ObjcZone is a Go-name alias for Objc_zone_t.
type Objc_AssociationPolicy ¶
type Objc_AssociationPolicy uint
See: https://developer.apple.com/documentation/ObjectiveC/objc_AssociationPolicy
const ( // OBJC_ASSOCIATION_ASSIGN: Specifies an unsafe unretained reference to the associated object. OBJC_ASSOCIATION_ASSIGN Objc_AssociationPolicy = 0 // OBJC_ASSOCIATION_COPY: Specifies that the associated object is copied, and that the association is made atomically. OBJC_ASSOCIATION_COPY Objc_AssociationPolicy = 771 // OBJC_ASSOCIATION_COPY_NONATOMIC: Specifies that the associated object is copied, and that the association is not made atomically. OBJC_ASSOCIATION_COPY_NONATOMIC Objc_AssociationPolicy = 3 // OBJC_ASSOCIATION_RETAIN: Specifies a strong reference to the associated object, and that the association is made atomically. OBJC_ASSOCIATION_RETAIN Objc_AssociationPolicy = 769 // OBJC_ASSOCIATION_RETAIN_NONATOMIC: Specifies a strong reference to the associated object, and that the association is not made atomically. OBJC_ASSOCIATION_RETAIN_NONATOMIC Objc_AssociationPolicy = 1 )
func (Objc_AssociationPolicy) String ¶
func (e Objc_AssociationPolicy) String() string
type Objc_associationPolicy ¶
type Objc_associationPolicy = uintptr
type Objc_category ¶
type Objc_category struct{}
type Objc_class ¶
type Objc_class struct{}
type Objc_exception_handler ¶
See: https://developer.apple.com/documentation/ObjectiveC/objc_exception_handler
type Objc_exception_matcher ¶
See: https://developer.apple.com/documentation/ObjectiveC/objc_exception_matcher
type Objc_exception_preprocessor ¶
See: https://developer.apple.com/documentation/ObjectiveC/objc_exception_preprocessor
type Objc_func_loadImage ¶
See: https://developer.apple.com/documentation/ObjectiveC/objc_func_loadImage
type Objc_hook_getClass ¶
See: https://developer.apple.com/documentation/ObjectiveC/objc_hook_getClass
type Objc_hook_getImageName ¶
type Objc_hook_getImageName = string
See: https://developer.apple.com/documentation/ObjectiveC/objc_hook_getImageName
type Objc_hook_lazyClassNamer ¶
See: https://developer.apple.com/documentation/ObjectiveC/objc_hook_lazyClassNamer
type Objc_method ¶
type Objc_method struct{}
type Objc_method_description ¶
type Objc_method_description struct {
Name SEL // The name of the method at runtime.
Types *byte // The types of the method arguments.
}
Objc_method_description - Defines an Objective-C method.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/ObjectiveC/objc_method_description
func Method_getDescription ¶
func Method_getDescription(m Method) *Objc_method_description
Method_getDescription returns a method description structure for a specified method.
It panics if method_getDescription is unavailable at run time; use TryMethod_getDescription to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/method_getDescription(_:)
func Protocol_copyMethodDescriptionList ¶
func Protocol_copyMethodDescriptionList(proto *Protocol, isRequiredMethod bool, isInstanceMethod bool, outCount *uint32) *Objc_method_description
Protocol_copyMethodDescriptionList returns an array of method descriptions of methods meeting a given specification for a given protocol.
It panics if protocol_copyMethodDescriptionList is unavailable at run time; use TryProtocol_copyMethodDescriptionList to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/protocol_copyMethodDescriptionList(_:_:_:_:)
func Protocol_getMethodDescription ¶
func Protocol_getMethodDescription(proto *Protocol, aSel SEL, isRequiredMethod bool, isInstanceMethod bool) Objc_method_description
Protocol_getMethodDescription returns a method description structure for a specified method of a given protocol.
It panics if protocol_getMethodDescription is unavailable at run time; use TryProtocol_getMethodDescription to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/protocol_getMethodDescription(_:_:_:_:)
func TryMethod_getDescription ¶
func TryMethod_getDescription(m Method) (*Objc_method_description, error)
TryMethod_getDescription is like Method_getDescription but returns an error instead of panicking if method_getDescription is unavailable at run time.
func TryProtocol_copyMethodDescriptionList ¶
func TryProtocol_copyMethodDescriptionList(proto *Protocol, isRequiredMethod bool, isInstanceMethod bool, outCount *uint32) (*Objc_method_description, error)
TryProtocol_copyMethodDescriptionList is like Protocol_copyMethodDescriptionList but returns an error instead of panicking if protocol_copyMethodDescriptionList is unavailable at run time.
func TryProtocol_getMethodDescription ¶
func TryProtocol_getMethodDescription(proto *Protocol, aSel SEL, isRequiredMethod bool, isInstanceMethod bool) (Objc_method_description, error)
TryProtocol_getMethodDescription is like Protocol_getMethodDescription but returns an error instead of panicking if protocol_getMethodDescription is unavailable at run time.
type Objc_object ¶
type Objc_object struct {
Isa objc.Class // A pointer to the class definition of which this object is an instance.
}
Objc_object - Represents an instance of a class.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/ObjectiveC/objc_object
type Objc_property ¶
type Objc_property struct{}
type Objc_property_attribute_t ¶
type Objc_property_attribute_t struct {
Name *byte // The name of the attribute.
Value *byte // The value of the attribute (usually empty).
}
Objc_property_attribute_t - Defines a property attribute.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/ObjectiveC/objc_property_attribute_t
func Property_copyAttributeList ¶
func Property_copyAttributeList(property unsafe.Pointer, outCount *uint32) *Objc_property_attribute_t
Property_copyAttributeList returns an array of property attributes for a given property.
It panics if property_copyAttributeList is unavailable at run time; use TryProperty_copyAttributeList to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/property_copyAttributeList(_:_:)
func TryProperty_copyAttributeList ¶
func TryProperty_copyAttributeList(property unsafe.Pointer, outCount *uint32) (*Objc_property_attribute_t, error)
TryProperty_copyAttributeList is like Property_copyAttributeList but returns an error instead of panicking if property_copyAttributeList is unavailable at run time.
type Objc_property_t ¶
Objc_property_t is an opaque type that represents an Objective-C declared property.
See: https://developer.apple.com/documentation/ObjectiveC/objc_property_t Objc_property_t is an unresolved C aggregate typedef.
func Class_copyPropertyList ¶
func Class_copyPropertyList(cls objc.Class, outCount *uint32) *Objc_property_t
Class_copyPropertyList describes the properties declared by a class.
It panics if class_copyPropertyList is unavailable at run time; use TryClass_copyPropertyList to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/class_copyPropertyList(_:_:)
func Protocol_copyPropertyList ¶
func Protocol_copyPropertyList(proto *Protocol, outCount *uint32) *Objc_property_t
Protocol_copyPropertyList returns an array of the properties declared by a protocol.
It panics if protocol_copyPropertyList is unavailable at run time; use TryProtocol_copyPropertyList to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/protocol_copyPropertyList(_:_:)
func Protocol_copyPropertyList2 ¶
func Protocol_copyPropertyList2(proto *Protocol, outCount *uint32, isRequiredProperty bool, isInstanceProperty bool) *Objc_property_t
Protocol_copyPropertyList2.
It panics if protocol_copyPropertyList2 is unavailable at run time; use TryProtocol_copyPropertyList2 to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/protocol_copyPropertyList2(_:_:_:_:)
func TryClass_copyPropertyList ¶
func TryClass_copyPropertyList(cls objc.Class, outCount *uint32) (*Objc_property_t, error)
TryClass_copyPropertyList is like Class_copyPropertyList but returns an error instead of panicking if class_copyPropertyList is unavailable at run time.
func TryProtocol_copyPropertyList ¶
func TryProtocol_copyPropertyList(proto *Protocol, outCount *uint32) (*Objc_property_t, error)
TryProtocol_copyPropertyList is like Protocol_copyPropertyList but returns an error instead of panicking if protocol_copyPropertyList is unavailable at run time.
func TryProtocol_copyPropertyList2 ¶
func TryProtocol_copyPropertyList2(proto *Protocol, outCount *uint32, isRequiredProperty bool, isInstanceProperty bool) (*Objc_property_t, error)
TryProtocol_copyPropertyList2 is like Protocol_copyPropertyList2 but returns an error instead of panicking if protocol_copyPropertyList2 is unavailable at run time.
type Objc_selector ¶
type Objc_selector struct{}
type Objc_super ¶
type Objc_super struct {
Receiver Object // A pointer of type [objc_object](<https://developer.apple.com/documentation/ObjectiveC/objc_object>). Specifies an instance of a class.
Super_class objc.Class // A pointer to a [Class](<https://developer.apple.com/documentation/ObjectiveC/Class>) data structure. Specifies the particular superclass of the instance to message.
}
Objc_super - Specifies the superclass of an instance.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/ObjectiveC/objc_super-swift.struct
type Objc_uncaught_exception_handler ¶
See: https://developer.apple.com/documentation/ObjectiveC/objc_uncaught_exception_handler
type Objc_zone_t ¶
type Objc_zone_t = uintptr
See: https://developer.apple.com/documentation/ObjectiveC/objc_zone_t
type Object ¶
Object wraps an Objective-C object ID. This is the base type embedded by all generated class types.
func Class_createInstance ¶
Class_createInstance creates an instance of a class, allocating memory for the class in the default malloc memory zone.
It panics if class_createInstance is unavailable at run time; use TryClass_createInstance to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/class_createInstance(_:_:)
func Class_createInstanceFromZone
deprecated
Class_createInstanceFromZone.
It panics if class_createInstanceFromZone is unavailable at run time; use TryClass_createInstanceFromZone to get an error instead.
Deprecated: Deprecated since macOS 10.5.
See: https://developer.apple.com/documentation/ObjectiveC/class_createInstanceFromZone
func Imp_getBlock ¶
Imp_getBlock returns the block associated with an IMP that was created using imp_implementationWithBlock(_:).
It panics if imp_getBlock is unavailable at run time; use TryImp_getBlock to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/imp_getBlock(_:)
func Objc_begin_catch ¶
Objc_begin_catch.
It panics if objc_begin_catch is unavailable at run time; use TryObjc_begin_catch to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/objc_begin_catch(_:)
func Objc_constructInstance ¶
Objc_constructInstance creates an instance of a class at the specified location.
It panics if objc_constructInstance is unavailable at run time; use TryObjc_constructInstance to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/objc_constructInstance
func Objc_getAssociatedObject ¶
Objc_getAssociatedObject returns the value associated with a given object for a given key.
It panics if objc_getAssociatedObject is unavailable at run time; use TryObjc_getAssociatedObject to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/objc_getAssociatedObject(_:_:)
func Objc_getClass ¶
Objc_getClass returns the class definition of a specified class.
It panics if objc_getClass is unavailable at run time; use TryObjc_getClass to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/objc_getClass(_:)
func Objc_getMetaClass ¶
Objc_getMetaClass returns the metaclass definition of a specified class.
It panics if objc_getMetaClass is unavailable at run time; use TryObjc_getMetaClass to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/objc_getMetaClass(_:)
func Objc_loadWeak ¶
Objc_loadWeak loads the object referenced by a weak pointer and returns it.
It panics if objc_loadWeak is unavailable at run time; use TryObjc_loadWeak to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/objc_loadWeak(_:)
func Objc_storeWeak ¶
Objc_storeWeak stores a new value in a `__weak` variable.
It panics if objc_storeWeak is unavailable at run time; use TryObjc_storeWeak to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/objc_storeWeak(_:_:)
func ObjectFromID ¶
ObjectFromID creates an Object from an objc.ID.
func Object_copy ¶
Object_copy returns a copy of a given object.
It panics if object_copy is unavailable at run time; use TryObject_copy to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/object_copy
func Object_copyFromZone
deprecated
Object_copyFromZone.
It panics if object_copyFromZone is unavailable at run time; use TryObject_copyFromZone to get an error instead.
Deprecated: Deprecated since macOS 10.5.
See: https://developer.apple.com/documentation/ObjectiveC/object_copyFromZone
func Object_dispose ¶
Object_dispose frees the memory occupied by a given object.
It panics if object_dispose is unavailable at run time; use TryObject_dispose to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/object_dispose
func Object_getIvar ¶
Object_getIvar reads the value of an instance variable in an object.
It panics if object_getIvar is unavailable at run time; use TryObject_getIvar to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/object_getIvar(_:_:)
func TryClass_createInstance ¶
TryClass_createInstance is like Class_createInstance but returns an error instead of panicking if class_createInstance is unavailable at run time.
func TryClass_createInstanceFromZone ¶
func TryClass_createInstanceFromZone(arg0 objc.Class, idxIvars uintptr, zone unsafe.Pointer) (Object, error)
TryClass_createInstanceFromZone is like Class_createInstanceFromZone but returns an error instead of panicking if class_createInstanceFromZone is unavailable at run time.
func TryImp_getBlock ¶
TryImp_getBlock is like Imp_getBlock but returns an error instead of panicking if imp_getBlock is unavailable at run time.
func TryObjc_begin_catch ¶
TryObjc_begin_catch is like Objc_begin_catch but returns an error instead of panicking if objc_begin_catch is unavailable at run time.
func TryObjc_constructInstance ¶
TryObjc_constructInstance is like Objc_constructInstance but returns an error instead of panicking if objc_constructInstance is unavailable at run time.
func TryObjc_getAssociatedObject ¶
TryObjc_getAssociatedObject is like Objc_getAssociatedObject but returns an error instead of panicking if objc_getAssociatedObject is unavailable at run time.
func TryObjc_getClass ¶
TryObjc_getClass is like Objc_getClass but returns an error instead of panicking if objc_getClass is unavailable at run time.
func TryObjc_getMetaClass ¶
TryObjc_getMetaClass is like Objc_getMetaClass but returns an error instead of panicking if objc_getMetaClass is unavailable at run time.
func TryObjc_loadWeak ¶
TryObjc_loadWeak is like Objc_loadWeak but returns an error instead of panicking if objc_loadWeak is unavailable at run time.
func TryObjc_storeWeak ¶
TryObjc_storeWeak is like Objc_storeWeak but returns an error instead of panicking if objc_storeWeak is unavailable at run time.
func TryObject_copy ¶
TryObject_copy is like Object_copy but returns an error instead of panicking if object_copy is unavailable at run time.
func TryObject_copyFromZone ¶
TryObject_copyFromZone is like Object_copyFromZone but returns an error instead of panicking if object_copyFromZone is unavailable at run time.
func TryObject_dispose ¶
TryObject_dispose is like Object_dispose but returns an error instead of panicking if object_dispose is unavailable at run time.
func TryObject_getIvar ¶
TryObject_getIvar is like Object_getIvar but returns an error instead of panicking if object_getIvar is unavailable at run time.
func (Object) Autorelease ¶
func (o Object) Autorelease()
Autorelease adds the object to the current autorelease pool.
func (Object) DebugDescription ¶
DebugDescription returns the object's debug description as a Go string.
func (Object) Description ¶
Description returns the object's description as a Go string.
func (Object) Release ¶
func (o Object) Release()
Release decrements the reference count of the object.
func (Object) RespondsToSelector ¶
RespondsToSelector returns true if the object responds to the given selector.
type Protocol ¶
type Protocol struct {
Object
}
See: https://developer.apple.com/documentation/ObjectiveC/Protocol
func Class_copyProtocolList ¶
Class_copyProtocolList describes the protocols adopted by a class.
It panics if class_copyProtocolList is unavailable at run time; use TryClass_copyProtocolList to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/class_copyProtocolList(_:_:)
func Objc_allocateProtocol ¶
Objc_allocateProtocol creates a new protocol instance.
It panics if objc_allocateProtocol is unavailable at run time; use TryObjc_allocateProtocol to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/objc_allocateProtocol(_:)
func Objc_copyProtocolList ¶
Objc_copyProtocolList returns an array of all the protocols known to the runtime.
It panics if objc_copyProtocolList is unavailable at run time; use TryObjc_copyProtocolList to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/objc_copyProtocolList(_:)
func Objc_getProtocol ¶
Objc_getProtocol returns a specified protocol.
It panics if objc_getProtocol is unavailable at run time; use TryObjc_getProtocol to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/objc_getProtocol(_:)
func ProtocolFromID ¶
ProtocolFromID constructs a Protocol from an objc.ID.
func Protocol_copyProtocolList ¶
Protocol_copyProtocolList returns an array of the protocols adopted by a protocol.
It panics if protocol_copyProtocolList is unavailable at run time; use TryProtocol_copyProtocolList to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/protocol_copyProtocolList(_:_:)
func TryClass_copyProtocolList ¶
TryClass_copyProtocolList is like Class_copyProtocolList but returns an error instead of panicking if class_copyProtocolList is unavailable at run time.
func TryObjc_allocateProtocol ¶
TryObjc_allocateProtocol is like Objc_allocateProtocol but returns an error instead of panicking if objc_allocateProtocol is unavailable at run time.
func TryObjc_copyProtocolList ¶
TryObjc_copyProtocolList is like Objc_copyProtocolList but returns an error instead of panicking if objc_copyProtocolList is unavailable at run time.
func TryObjc_getProtocol ¶
TryObjc_getProtocol is like Objc_getProtocol but returns an error instead of panicking if objc_getProtocol is unavailable at run time.
func TryProtocol_copyProtocolList ¶
TryProtocol_copyProtocolList is like Protocol_copyProtocolList but returns an error instead of panicking if protocol_copyProtocolList is unavailable at run time.
func (Protocol) Autorelease ¶
Autorelease adds the receiver to the current autorelease pool.
type ProtocolClass ¶
type ProtocolClass struct {
// contains filtered or unexported fields
}
func GetProtocolClass ¶
func GetProtocolClass() ProtocolClass
GetProtocolClass returns the class object for Protocol.
func (ProtocolClass) Alloc ¶
func (pc ProtocolClass) Alloc() Protocol
Alloc allocates memory for a new instance of the class.
func (ProtocolClass) Class ¶ added in v0.5.0
func (pc ProtocolClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type SEL ¶
type SEL = uintptr
SEL is defines an opaque type that represents a method selector.
See: https://developer.apple.com/documentation/ObjectiveC/SEL
func Method_getName ¶
Method_getName returns the name of a method.
It panics if method_getName is unavailable at run time; use TryMethod_getName to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/method_getName(_:)
func Sel_getUid ¶
Sel_getUid registers a method name with the Objective-C runtime system.
It panics if sel_getUid is unavailable at run time; use TrySel_getUid to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/sel_getUid(_:)
func Sel_registerName ¶
Sel_registerName registers a method with the Objective-C runtime system, maps the method name to a selector, and returns the selector value.
It panics if sel_registerName is unavailable at run time; use TrySel_registerName to get an error instead.
See: https://developer.apple.com/documentation/ObjectiveC/sel_registerName(_:)
func TryMethod_getName ¶
TryMethod_getName is like Method_getName but returns an error instead of panicking if method_getName is unavailable at run time.
func TrySel_getUid ¶
TrySel_getUid is like Sel_getUid but returns an error instead of panicking if sel_getUid is unavailable at run time.
func TrySel_registerName ¶
TrySel_registerName is like Sel_registerName but returns an error instead of panicking if sel_registerName is unavailable at run time.