objectivec

package
v0.6.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2026 License: MIT Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindFunc

func BindFunc(fptr any, name string) (err error)

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

func ClassSliceToNSArray(slice []objc.Class) objc.ID

ClassSliceToNSArray converts a slice of objc.Class to an NSArray.

func Class_addIvar

func Class_addIvar(cls objc.Class, name string, size uintptr, alignment uint8, types string) bool

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

func Class_addMethod(cls objc.Class, name SEL, imp IMP, types string) bool

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

func Class_addProtocol(cls objc.Class, protocol_ *Protocol) bool

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

func Class_conformsToProtocol(cls objc.Class, protocol_ *Protocol) bool

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

func Class_getImageName(cls objc.Class) *byte

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

func Class_getInstanceSize(cls objc.Class) uintptr

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

func Class_getIvarLayout(cls objc.Class) *uint8

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

func Class_getName(cls objc.Class) *byte

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

func Class_getProperty(cls objc.Class, name string) unsafe.Pointer

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

func Class_getSuperclass(cls objc.Class) objc.Class

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

func Class_getVersion(cls objc.Class) int32

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

func Class_getWeakIvarLayout(cls objc.Class) *uint8

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

func Class_isMetaClass(cls objc.Class) bool

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

func Class_respondsToSelector(cls objc.Class, sel SEL) bool

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

func Class_setIvarLayout(cls objc.Class, layout []byte)

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

func Class_setVersion(cls objc.Class, version int32)

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

func Class_setWeakIvarLayout(cls objc.Class, layout []byte)

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

func IDSliceToNSArray(slice []objc.ID) objc.ID

IDSliceToNSArray converts a slice of objc.ID to an NSArray.

func IObjectSliceToNSArray

func IObjectSliceToNSArray[T IObject](slice []T) objc.ID

IObjectSliceToNSArray converts a slice of IObject-implementing types to an NSArray.

func Imp_removeBlock

func Imp_removeBlock(anImp IMP) bool

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

func Ivar_getName(v Ivar) *byte

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

func Ivar_getOffset(v Ivar) int

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

func Ivar_getTypeEncoding(v Ivar) *byte

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

func Method_copyArgumentType(m Method, index uint32) *byte

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

func Method_copyReturnType(m Method) *byte

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

func Method_exchangeImplementations(m1 Method, m2 Method)

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

func Method_getArgumentType(m Method, index uint32, dst *byte, dst_len uintptr)

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

func Method_getNumberOfArguments(m Method) uint32

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

func Method_getReturnType(m Method, dst *byte, dst_len uintptr)

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

func Method_getTypeEncoding(m Method) *byte

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

func NXNoEffectFree(info unsafe.Pointer, data unsafe.Pointer)

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

func NXPtrHash(info unsafe.Pointer, data unsafe.Pointer) uintptr

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

func NXPtrIsEqual(info unsafe.Pointer, data1 unsafe.Pointer, data2 unsafe.Pointer) int32

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

func NXReallyFree(info unsafe.Pointer, data unsafe.Pointer)

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

func NXStrHash(info unsafe.Pointer, data unsafe.Pointer) uintptr

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

func NXStrIsEqual(info unsafe.Pointer, data1 unsafe.Pointer, data2 unsafe.Pointer) int32

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

func NumberSliceToNSArray[T any](slice []T) objc.ID

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

func NumberToID[T any](v T) objc.ID

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

func Objc_addExceptionHandler(fn unsafe.Pointer, context unsafe.Pointer) uintptr

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

func Objc_addLoadImageFunc(func_ unsafe.Pointer)

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

func Objc_allocateClassPair(superclass objc.Class, name string, extraBytes uintptr) objc.Class

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

func Objc_copyClassList(outCount *uint32) objc.Class

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

func Objc_copyClassNamesForImage(image string, outCount *uint32) **byte

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

func Objc_copyImageNames(outCount *uint32) **byte

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

func Objc_destructInstance(obj Object) unsafe.Pointer

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

func Objc_disposeClassPair(cls objc.Class)

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

func Objc_duplicateClass(original objc.Class, name string, extraBytes uintptr) objc.Class

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

func Objc_getClassList(buffer objc.Class, bufferCount int32) int32

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

func Objc_getFutureClass(name string) objc.Class

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

func Objc_getRequiredClass(name string) objc.Class

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

func Objc_lookUpClass(name string) objc.Class

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

func Objc_registerClassPair(cls objc.Class)

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

func Objc_setExceptionMatcher(fn unsafe.Pointer) unsafe.Pointer

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

func Objc_setExceptionPreprocessor(fn unsafe.Pointer) unsafe.Pointer

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

func Objc_setForwardHandler(fwd unsafe.Pointer, fwd_stret unsafe.Pointer)

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

func Objc_setUncaughtExceptionHandler(fn unsafe.Pointer) unsafe.Pointer

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

func Objc_sync_enter(obj Object) int32

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

func Objc_sync_exit(obj Object) int32

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

func Object_getClass(obj Object) objc.Class

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

func Object_getClassName(obj Object) *byte

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

func Object_getIndexedIvars(obj Object) unsafe.Pointer

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

func Object_isClass(obj Object) bool

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

func Object_setClass(obj Object, cls objc.Class) objc.Class

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

func Object_setIvar(obj Object, ivar Ivar, value Object)

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

func Object_setIvarWithStrongDefault(obj Object, ivar Ivar, value Object)

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

func Property_copyAttributeValue(property unsafe.Pointer, attributeName string) *byte

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

func Property_getAttributes(property unsafe.Pointer) *byte

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

func Property_getName(property unsafe.Pointer) *byte

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

func Protocol_addProtocol(proto *Protocol, addition *Protocol)

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

func Protocol_conformsToProtocol(proto *Protocol, other *Protocol) bool

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

func Protocol_getName(proto *Protocol) *byte

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

func Protocol_isEqual(proto *Protocol, other *Protocol) bool

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

func Sel_getName(sel SEL) *byte

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

func Sel_isEqual(lhs SEL, rhs SEL) bool

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

func Sel_isMapped(sel SEL) bool

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

func SliceToNSArray[T any](slice []T, toID func(T) objc.ID) objc.ID

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

func StringSliceToNSArray(slice []string) objc.ID

StringSliceToNSArray converts a Go []string to an NSArray of NSString objects.

func SymbolAddress

func SymbolAddress(name string) (uintptr, error)

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

func TryClass_addMethod(cls objc.Class, name SEL, imp IMP, types string) (bool, error)

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

func TryClass_addProtocol(cls objc.Class, protocol_ *Protocol) (bool, error)

TryClass_addProtocol is like Class_addProtocol but returns an error instead of panicking if class_addProtocol is unavailable at run time.

func TryClass_conformsToProtocol

func TryClass_conformsToProtocol(cls objc.Class, protocol_ *Protocol) (bool, error)

TryClass_conformsToProtocol is like Class_conformsToProtocol but returns an error instead of panicking if class_conformsToProtocol is unavailable at run time.

func TryClass_getImageName

func TryClass_getImageName(cls objc.Class) (*byte, error)

TryClass_getImageName is like Class_getImageName but returns an error instead of panicking if class_getImageName is unavailable at run time.

func TryClass_getInstanceSize

func TryClass_getInstanceSize(cls objc.Class) (uintptr, error)

TryClass_getInstanceSize is like Class_getInstanceSize but returns an error instead of panicking if class_getInstanceSize is unavailable at run time.

func TryClass_getIvarLayout

func TryClass_getIvarLayout(cls objc.Class) (*uint8, error)

TryClass_getIvarLayout is like Class_getIvarLayout but returns an error instead of panicking if class_getIvarLayout is unavailable at run time.

func TryClass_getName

func TryClass_getName(cls objc.Class) (*byte, error)

TryClass_getName is like Class_getName but returns an error instead of panicking if class_getName is unavailable at run time.

func TryClass_getProperty

func TryClass_getProperty(cls objc.Class, name string) (unsafe.Pointer, error)

TryClass_getProperty is like Class_getProperty but returns an error instead of panicking if class_getProperty is unavailable at run time.

func TryClass_getSuperclass

func TryClass_getSuperclass(cls objc.Class) (objc.Class, error)

TryClass_getSuperclass is like Class_getSuperclass but returns an error instead of panicking if class_getSuperclass is unavailable at run time.

func TryClass_getVersion

func TryClass_getVersion(cls objc.Class) (int32, error)

TryClass_getVersion is like Class_getVersion but returns an error instead of panicking if class_getVersion is unavailable at run time.

func TryClass_getWeakIvarLayout

func TryClass_getWeakIvarLayout(cls objc.Class) (*uint8, error)

TryClass_getWeakIvarLayout is like Class_getWeakIvarLayout but returns an error instead of panicking if class_getWeakIvarLayout is unavailable at run time.

func TryClass_isMetaClass

func TryClass_isMetaClass(cls objc.Class) (bool, error)

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

func TryClass_respondsToSelector(cls objc.Class, sel SEL) (bool, error)

TryClass_respondsToSelector is like Class_respondsToSelector but returns an error instead of panicking if class_respondsToSelector is unavailable at run time.

func TryClass_setIvarLayout

func TryClass_setIvarLayout(cls objc.Class, layout []byte) error

TryClass_setIvarLayout is like Class_setIvarLayout but returns an error instead of panicking if class_setIvarLayout is unavailable at run time.

func TryClass_setVersion

func TryClass_setVersion(cls objc.Class, version int32) error

TryClass_setVersion is like Class_setVersion but returns an error instead of panicking if class_setVersion is unavailable at run time.

func TryClass_setWeakIvarLayout

func TryClass_setWeakIvarLayout(cls objc.Class, layout []byte) error

TryClass_setWeakIvarLayout is like Class_setWeakIvarLayout but returns an error instead of panicking if class_setWeakIvarLayout is unavailable at run time.

func TryImp_removeBlock

func TryImp_removeBlock(anImp IMP) (bool, error)

TryImp_removeBlock is like Imp_removeBlock but returns an error instead of panicking if imp_removeBlock is unavailable at run time.

func TryIvar_getName

func TryIvar_getName(v Ivar) (*byte, error)

TryIvar_getName is like Ivar_getName but returns an error instead of panicking if ivar_getName is unavailable at run time.

func TryIvar_getOffset

func TryIvar_getOffset(v Ivar) (int, error)

TryIvar_getOffset is like Ivar_getOffset but returns an error instead of panicking if ivar_getOffset is unavailable at run time.

func TryIvar_getTypeEncoding

func TryIvar_getTypeEncoding(v Ivar) (*byte, error)

TryIvar_getTypeEncoding is like Ivar_getTypeEncoding but returns an error instead of panicking if ivar_getTypeEncoding is unavailable at run time.

func TryMethod_copyArgumentType

func TryMethod_copyArgumentType(m Method, index uint32) (*byte, error)

TryMethod_copyArgumentType is like Method_copyArgumentType but returns an error instead of panicking if method_copyArgumentType is unavailable at run time.

func TryMethod_copyReturnType

func TryMethod_copyReturnType(m Method) (*byte, error)

TryMethod_copyReturnType is like Method_copyReturnType but returns an error instead of panicking if method_copyReturnType is unavailable at run time.

func TryMethod_exchangeImplementations

func TryMethod_exchangeImplementations(m1 Method, m2 Method) error

TryMethod_exchangeImplementations is like Method_exchangeImplementations but returns an error instead of panicking if method_exchangeImplementations is unavailable at run time.

func TryMethod_getArgumentType

func TryMethod_getArgumentType(m Method, index uint32, dst *byte, dst_len uintptr) error

TryMethod_getArgumentType is like Method_getArgumentType but returns an error instead of panicking if method_getArgumentType is unavailable at run time.

func TryMethod_getNumberOfArguments

func TryMethod_getNumberOfArguments(m Method) (uint32, error)

TryMethod_getNumberOfArguments is like Method_getNumberOfArguments but returns an error instead of panicking if method_getNumberOfArguments is unavailable at run time.

func TryMethod_getReturnType

func TryMethod_getReturnType(m Method, dst *byte, dst_len uintptr) error

TryMethod_getReturnType is like Method_getReturnType but returns an error instead of panicking if method_getReturnType is unavailable at run time.

func TryMethod_getTypeEncoding

func TryMethod_getTypeEncoding(m Method) (*byte, error)

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

func TryNXHashGet(table *NXHashTable, data unsafe.Pointer) (unsafe.Pointer, error)

TryNXHashGet is like NXHashGet but returns an error instead of panicking if NXHashGet is unavailable at run time.

func TryNXHashInsert

func TryNXHashInsert(table *NXHashTable, data unsafe.Pointer) (unsafe.Pointer, error)

TryNXHashInsert is like NXHashInsert but returns an error instead of panicking if NXHashInsert is unavailable at run time.

func TryNXHashInsertIfAbsent

func TryNXHashInsertIfAbsent(table *NXHashTable, data unsafe.Pointer) (unsafe.Pointer, error)

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

func TryNXHashRemove(table *NXHashTable, data unsafe.Pointer) (unsafe.Pointer, error)

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

func TryNXNoEffectFree(info unsafe.Pointer, data unsafe.Pointer) error

TryNXNoEffectFree is like NXNoEffectFree but returns an error instead of panicking if NXNoEffectFree is unavailable at run time.

func TryNXPtrHash

func TryNXPtrHash(info unsafe.Pointer, data unsafe.Pointer) (uintptr, error)

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

func TryNXReallyFree(info unsafe.Pointer, data unsafe.Pointer) error

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

func TryNXStrHash(info unsafe.Pointer, data unsafe.Pointer) (uintptr, error)

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

func TryObjc_addExceptionHandler(fn unsafe.Pointer, context unsafe.Pointer) (uintptr, error)

TryObjc_addExceptionHandler is like Objc_addExceptionHandler but returns an error instead of panicking if objc_addExceptionHandler is unavailable at run time.

func TryObjc_addLoadImageFunc

func TryObjc_addLoadImageFunc(func_ unsafe.Pointer) error

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

func TryObjc_copyClassList(outCount *uint32) (objc.Class, error)

TryObjc_copyClassList is like Objc_copyClassList but returns an error instead of panicking if objc_copyClassList is unavailable at run time.

func TryObjc_copyClassNamesForImage

func TryObjc_copyClassNamesForImage(image string, outCount *uint32) (**byte, error)

TryObjc_copyClassNamesForImage is like Objc_copyClassNamesForImage but returns an error instead of panicking if objc_copyClassNamesForImage is unavailable at run time.

func TryObjc_copyImageNames

func TryObjc_copyImageNames(outCount *uint32) (**byte, error)

TryObjc_copyImageNames is like Objc_copyImageNames but returns an error instead of panicking if objc_copyImageNames is unavailable at run time.

func TryObjc_destructInstance

func TryObjc_destructInstance(obj Object) (unsafe.Pointer, error)

TryObjc_destructInstance is like Objc_destructInstance but returns an error instead of panicking if objc_destructInstance is unavailable at run time.

func TryObjc_disposeClassPair

func TryObjc_disposeClassPair(cls objc.Class) error

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

func TryObjc_enumerationMutation(obj Object) error

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

func TryObjc_exception_throw(exception Object) error

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

func TryObjc_getClassList(buffer objc.Class, bufferCount int32) (int32, error)

TryObjc_getClassList is like Objc_getClassList but returns an error instead of panicking if objc_getClassList is unavailable at run time.

func TryObjc_getFutureClass

func TryObjc_getFutureClass(name string) (objc.Class, error)

TryObjc_getFutureClass is like Objc_getFutureClass but returns an error instead of panicking if objc_getFutureClass is unavailable at run time.

func TryObjc_getRequiredClass

func TryObjc_getRequiredClass(name string) (objc.Class, error)

TryObjc_getRequiredClass is like Objc_getRequiredClass but returns an error instead of panicking if objc_getRequiredClass is unavailable at run time.

func TryObjc_lookUpClass

func TryObjc_lookUpClass(name string) (objc.Class, error)

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

func TryObjc_registerClassPair(cls objc.Class) error

TryObjc_registerClassPair is like Objc_registerClassPair but returns an error instead of panicking if objc_registerClassPair is unavailable at run time.

func TryObjc_registerProtocol

func TryObjc_registerProtocol(proto *Protocol) error

TryObjc_registerProtocol is like Objc_registerProtocol but returns an error instead of panicking if objc_registerProtocol is unavailable at run time.

func TryObjc_removeAssociatedObjects

func TryObjc_removeAssociatedObjects(object Object) error

TryObjc_removeAssociatedObjects is like Objc_removeAssociatedObjects but returns an error instead of panicking if objc_removeAssociatedObjects is unavailable at run time.

func TryObjc_removeExceptionHandler

func TryObjc_removeExceptionHandler(token uintptr) error

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

func TryObjc_setEnumerationMutationHandler(handler func(Object)) error

TryObjc_setEnumerationMutationHandler is like Objc_setEnumerationMutationHandler but returns an error instead of panicking if objc_setEnumerationMutationHandler is unavailable at run time.

func TryObjc_setExceptionMatcher

func TryObjc_setExceptionMatcher(fn unsafe.Pointer) (unsafe.Pointer, error)

TryObjc_setExceptionMatcher is like Objc_setExceptionMatcher but returns an error instead of panicking if objc_setExceptionMatcher is unavailable at run time.

func TryObjc_setExceptionPreprocessor

func TryObjc_setExceptionPreprocessor(fn unsafe.Pointer) (unsafe.Pointer, error)

TryObjc_setExceptionPreprocessor is like Objc_setExceptionPreprocessor but returns an error instead of panicking if objc_setExceptionPreprocessor is unavailable at run time.

func TryObjc_setForwardHandler

func TryObjc_setForwardHandler(fwd unsafe.Pointer, fwd_stret unsafe.Pointer) error

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

func TryObjc_setUncaughtExceptionHandler(fn unsafe.Pointer) (unsafe.Pointer, error)

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

func TryObjc_sync_enter(obj Object) (int32, error)

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

func TryObjc_sync_exit(obj Object) (int32, error)

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

func TryObject_getClass(obj Object) (objc.Class, error)

TryObject_getClass is like Object_getClass but returns an error instead of panicking if object_getClass is unavailable at run time.

func TryObject_getClassName

func TryObject_getClassName(obj Object) (*byte, error)

TryObject_getClassName is like Object_getClassName but returns an error instead of panicking if object_getClassName is unavailable at run time.

func TryObject_getIndexedIvars

func TryObject_getIndexedIvars(obj Object) (unsafe.Pointer, error)

TryObject_getIndexedIvars is like Object_getIndexedIvars but returns an error instead of panicking if object_getIndexedIvars is unavailable at run time.

func TryObject_isClass

func TryObject_isClass(obj Object) (bool, error)

TryObject_isClass is like Object_isClass but returns an error instead of panicking if object_isClass is unavailable at run time.

func TryObject_setClass

func TryObject_setClass(obj Object, cls objc.Class) (objc.Class, error)

TryObject_setClass is like Object_setClass but returns an error instead of panicking if object_setClass is unavailable at run time.

func TryObject_setIvar

func TryObject_setIvar(obj Object, ivar Ivar, value Object) error

TryObject_setIvar is like Object_setIvar but returns an error instead of panicking if object_setIvar is unavailable at run time.

func TryObject_setIvarWithStrongDefault

func TryObject_setIvarWithStrongDefault(obj Object, ivar Ivar, value Object) error

TryObject_setIvarWithStrongDefault is like Object_setIvarWithStrongDefault but returns an error instead of panicking if object_setIvarWithStrongDefault is unavailable at run time.

func TryProperty_copyAttributeValue

func TryProperty_copyAttributeValue(property unsafe.Pointer, attributeName string) (*byte, error)

TryProperty_copyAttributeValue is like Property_copyAttributeValue but returns an error instead of panicking if property_copyAttributeValue is unavailable at run time.

func TryProperty_getAttributes

func TryProperty_getAttributes(property unsafe.Pointer) (*byte, error)

TryProperty_getAttributes is like Property_getAttributes but returns an error instead of panicking if property_getAttributes is unavailable at run time.

func TryProperty_getName

func TryProperty_getName(property unsafe.Pointer) (*byte, error)

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

func TryProtocol_addProtocol(proto *Protocol, addition *Protocol) error

TryProtocol_addProtocol is like Protocol_addProtocol but returns an error instead of panicking if protocol_addProtocol is unavailable at run time.

func TryProtocol_conformsToProtocol

func TryProtocol_conformsToProtocol(proto *Protocol, other *Protocol) (bool, error)

TryProtocol_conformsToProtocol is like Protocol_conformsToProtocol but returns an error instead of panicking if protocol_conformsToProtocol is unavailable at run time.

func TryProtocol_getName

func TryProtocol_getName(proto *Protocol) (*byte, error)

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

func TryProtocol_isEqual(proto *Protocol, other *Protocol) (bool, error)

TryProtocol_isEqual is like Protocol_isEqual but returns an error instead of panicking if protocol_isEqual is unavailable at run time.

func TrySel_getName

func TrySel_getName(sel SEL) (*byte, error)

TrySel_getName is like Sel_getName but returns an error instead of panicking if sel_getName is unavailable at run time.

func TrySel_isEqual

func TrySel_isEqual(lhs SEL, rhs SEL) (bool, error)

TrySel_isEqual is like Sel_isEqual but returns an error instead of panicking if sel_isEqual is unavailable at run time.

func TrySel_isMapped

func TrySel_isMapped(sel SEL) (bool, error)

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

type Class = objc.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

func Class_getMethodImplementation(cls objc.Class, name SEL) IMP

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

func Class_replaceMethod(cls objc.Class, name SEL, imp IMP, types string) IMP

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

func Imp_implementationWithBlock(block Object) IMP

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

func Method_getImplementation(m Method) IMP

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

func Method_setImplementation(m Method, imp IMP) IMP

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

func TryClass_getMethodImplementation(cls objc.Class, name SEL) (IMP, error)

TryClass_getMethodImplementation is like Class_getMethodImplementation but returns an error instead of panicking if class_getMethodImplementation is unavailable at run time.

func TryClass_replaceMethod

func TryClass_replaceMethod(cls objc.Class, name SEL, imp IMP, types string) (IMP, error)

TryClass_replaceMethod is like Class_replaceMethod but returns an error instead of panicking if class_replaceMethod is unavailable at run time.

func TryImp_implementationWithBlock

func TryImp_implementationWithBlock(block Object) (IMP, error)

TryImp_implementationWithBlock is like Imp_implementationWithBlock but returns an error instead of panicking if imp_implementationWithBlock is unavailable at run time.

func TryMethod_getImplementation

func TryMethod_getImplementation(m Method) (IMP, error)

TryMethod_getImplementation is like Method_getImplementation but returns an error instead of panicking if method_getImplementation is unavailable at run time.

func TryMethod_setImplementation

func TryMethod_setImplementation(m Method, imp IMP) (IMP, error)

TryMethod_setImplementation is like Method_setImplementation but returns an error instead of panicking if method_setImplementation is unavailable at run time.

type IObject

type IObject interface {
	GetID() objc.ID
}

IObject is the interface implemented by all Objective-C object wrappers.

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

func Class_copyIvarList(cls objc.Class, outCount *uint32) Ivar

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

func Class_getClassVariable(cls objc.Class, name string) Ivar

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

func Class_getInstanceVariable(cls objc.Class, name string) Ivar

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

func Object_getInstanceVariable(obj Object, name string, outValue unsafe.Pointer) Ivar

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

func Object_setInstanceVariable(obj Object, name string, value unsafe.Pointer) Ivar

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

func TryClass_copyIvarList(cls objc.Class, outCount *uint32) (Ivar, error)

TryClass_copyIvarList is like Class_copyIvarList but returns an error instead of panicking if class_copyIvarList is unavailable at run time.

func TryClass_getClassVariable

func TryClass_getClassVariable(cls objc.Class, name string) (Ivar, error)

TryClass_getClassVariable is like Class_getClassVariable but returns an error instead of panicking if class_getClassVariable is unavailable at run time.

func TryClass_getInstanceVariable

func TryClass_getInstanceVariable(cls objc.Class, name string) (Ivar, error)

TryClass_getInstanceVariable is like Class_getInstanceVariable but returns an error instead of panicking if class_getInstanceVariable is unavailable at run time.

func TryObject_getInstanceVariable

func TryObject_getInstanceVariable(obj Object, name string, outValue unsafe.Pointer) (Ivar, error)

TryObject_getInstanceVariable is like Object_getInstanceVariable but returns an error instead of panicking if object_getInstanceVariable is unavailable at run time.

func TryObject_setInstanceVariable

func TryObject_setInstanceVariable(obj Object, name string, value unsafe.Pointer) (Ivar, error)

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

func Class_copyMethodList(cls objc.Class, outCount *uint32) Method

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

func Class_getClassMethod(cls objc.Class, name SEL) Method

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

func Class_getInstanceMethod(cls objc.Class, name SEL) Method

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

func TryClass_copyMethodList(cls objc.Class, outCount *uint32) (Method, error)

TryClass_copyMethodList is like Class_copyMethodList but returns an error instead of panicking if class_copyMethodList is unavailable at run time.

func TryClass_getClassMethod

func TryClass_getClassMethod(cls objc.Class, name SEL) (Method, error)

TryClass_getClassMethod is like Class_getClassMethod but returns an error instead of panicking if class_getClassMethod is unavailable at run time.

func TryClass_getInstanceMethod

func TryClass_getInstanceMethod(cls objc.Class, name SEL) (Method, error)

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

type NXHashState struct {
	I int32
	J int32
}

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 ObjC

type ObjC uint32
const (
	OBJC_COLLECT_IF_NEEDED       ObjC = 8
	OBJC_EXHAUSTIVE_COLLECTION   ObjC = 3
	OBJC_FULL_COLLECTION         ObjC = 2
	OBJC_GENERATIONAL_COLLECTION ObjC = 1
	OBJC_RATIO_COLLECTION        ObjC = 0
	OBJC_WAIT_UNTIL_DONE         ObjC = 16
)

func (ObjC) String

func (e ObjC) String() string

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 ObjCSync

type ObjCSync uint
const (
	OBJC_SYNC_NOT_OWNING_THREAD_ERROR ObjCSync = 0
	OBJC_SYNC_SUCCESS                 ObjCSync = 0
)

func (ObjCSync) String

func (e ObjCSync) 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_ivar

type Objc_ivar struct{}

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

type Objc_property_t unsafe.Pointer

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 Object

type Object struct {
	ID objc.ID
}

Object wraps an Objective-C object ID. This is the base type embedded by all generated class types.

func Class_createInstance

func Class_createInstance(cls objc.Class, extraBytes uintptr) Object

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

func Class_createInstanceFromZone(arg0 objc.Class, idxIvars uintptr, zone unsafe.Pointer) Object

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

func Imp_getBlock(anImp IMP) Object

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

func Objc_begin_catch(exc_buf unsafe.Pointer) Object

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

func Objc_constructInstance(cls objc.Class, bytes unsafe.Pointer) Object

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

func Objc_getAssociatedObject(object Object, key unsafe.Pointer) Object

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

func Objc_getClass(name string) Object

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

func Objc_getMetaClass(name string) Object

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

func Objc_loadWeak(location objc.ID) Object

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

func Objc_storeWeak(location objc.ID, obj Object) Object

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

func ObjectFromID(id objc.ID) Object

ObjectFromID creates an Object from an objc.ID.

func Object_copy

func Object_copy(obj Object, size uintptr) Object

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

func Object_copyFromZone(anObject Object, nBytes uintptr, zone unsafe.Pointer) Object

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

func Object_dispose(obj Object) Object

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

func Object_getIvar(obj Object, ivar Ivar) Object

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

func TryClass_createInstance(cls objc.Class, extraBytes uintptr) (Object, error)

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

func TryImp_getBlock(anImp IMP) (Object, error)

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

func TryObjc_begin_catch(exc_buf unsafe.Pointer) (Object, error)

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

func TryObjc_constructInstance(cls objc.Class, bytes unsafe.Pointer) (Object, error)

TryObjc_constructInstance is like Objc_constructInstance but returns an error instead of panicking if objc_constructInstance is unavailable at run time.

func TryObjc_getAssociatedObject

func TryObjc_getAssociatedObject(object Object, key unsafe.Pointer) (Object, error)

TryObjc_getAssociatedObject is like Objc_getAssociatedObject but returns an error instead of panicking if objc_getAssociatedObject is unavailable at run time.

func TryObjc_getClass

func TryObjc_getClass(name string) (Object, error)

TryObjc_getClass is like Objc_getClass but returns an error instead of panicking if objc_getClass is unavailable at run time.

func TryObjc_getMetaClass

func TryObjc_getMetaClass(name string) (Object, error)

TryObjc_getMetaClass is like Objc_getMetaClass but returns an error instead of panicking if objc_getMetaClass is unavailable at run time.

func TryObjc_loadWeak

func TryObjc_loadWeak(location objc.ID) (Object, error)

TryObjc_loadWeak is like Objc_loadWeak but returns an error instead of panicking if objc_loadWeak is unavailable at run time.

func TryObjc_storeWeak

func TryObjc_storeWeak(location objc.ID, obj Object) (Object, error)

TryObjc_storeWeak is like Objc_storeWeak but returns an error instead of panicking if objc_storeWeak is unavailable at run time.

func TryObject_copy

func TryObject_copy(obj Object, size uintptr) (Object, error)

TryObject_copy is like Object_copy but returns an error instead of panicking if object_copy is unavailable at run time.

func TryObject_copyFromZone

func TryObject_copyFromZone(anObject Object, nBytes uintptr, zone unsafe.Pointer) (Object, error)

TryObject_copyFromZone is like Object_copyFromZone but returns an error instead of panicking if object_copyFromZone is unavailable at run time.

func TryObject_dispose

func TryObject_dispose(obj Object) (Object, error)

TryObject_dispose is like Object_dispose but returns an error instead of panicking if object_dispose is unavailable at run time.

func TryObject_getIvar

func TryObject_getIvar(obj Object, ivar Ivar) (Object, error)

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

func (o Object) DebugDescription() string

DebugDescription returns the object's debug description as a Go string.

func (Object) Description

func (o Object) Description() string

Description returns the object's description as a Go string.

func (Object) GetID

func (o Object) GetID() objc.ID

GetID returns the underlying Objective-C object ID.

func (Object) Release

func (o Object) Release()

Release decrements the reference count of the object.

func (Object) RespondsToSelector

func (o Object) RespondsToSelector(sel objc.SEL) bool

RespondsToSelector returns true if the object responds to the given selector.

func (Object) Retain

func (o Object) Retain()

Retain increments the reference count of the object.

func (Object) String

func (o Object) String() string

String implements fmt.Stringer by calling Description.

type Protocol

type Protocol = objc.Protocol

Protocol is an alias for objc.Protocol so objc.GetProtocol and [foundation.NSProtocolFromString] produce the same pointer type.

See: https://developer.apple.com/documentation/ObjectiveC/Protocol

func Class_copyProtocolList

func Class_copyProtocolList(cls objc.Class, outCount *uint32) **Protocol

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

func Objc_allocateProtocol(name string) *Protocol

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

func Objc_copyProtocolList(outCount *uint32) **Protocol

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

func Objc_getProtocol(name string) *Protocol

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

func ProtocolFromID(id objc.ID) *Protocol

ProtocolFromID converts an objc.ID (raw Protocol* pointer) to a *Protocol.

func Protocol_copyProtocolList

func Protocol_copyProtocolList(proto *Protocol, outCount *uint32) **Protocol

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

func TryClass_copyProtocolList(cls objc.Class, outCount *uint32) (**Protocol, error)

TryClass_copyProtocolList is like Class_copyProtocolList but returns an error instead of panicking if class_copyProtocolList is unavailable at run time.

func TryObjc_allocateProtocol

func TryObjc_allocateProtocol(name string) (*Protocol, error)

TryObjc_allocateProtocol is like Objc_allocateProtocol but returns an error instead of panicking if objc_allocateProtocol is unavailable at run time.

func TryObjc_copyProtocolList

func TryObjc_copyProtocolList(outCount *uint32) (**Protocol, error)

TryObjc_copyProtocolList is like Objc_copyProtocolList but returns an error instead of panicking if objc_copyProtocolList is unavailable at run time.

func TryObjc_getProtocol

func TryObjc_getProtocol(name string) (*Protocol, error)

TryObjc_getProtocol is like Objc_getProtocol but returns an error instead of panicking if objc_getProtocol is unavailable at run time.

func TryProtocol_copyProtocolList

func TryProtocol_copyProtocolList(proto *Protocol, outCount *uint32) (**Protocol, error)

TryProtocol_copyProtocolList is like Protocol_copyProtocolList but returns an error instead of panicking if protocol_copyProtocolList is unavailable at run time.

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

func Method_getName(m Method) SEL

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

func Sel_getUid(str string) SEL

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

func Sel_registerName(str string) SEL

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

func TryMethod_getName(m Method) (SEL, error)

TryMethod_getName is like Method_getName but returns an error instead of panicking if method_getName is unavailable at run time.

func TrySel_getUid

func TrySel_getUid(str string) (SEL, error)

TrySel_getUid is like Sel_getUid but returns an error instead of panicking if sel_getUid is unavailable at run time.

func TrySel_registerName

func TrySel_registerName(str string) (SEL, error)

TrySel_registerName is like Sel_registerName but returns an error instead of panicking if sel_registerName is unavailable at run time.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL