objectivec

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2026 License: MIT Imports: 6 Imported by: 0

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](<doc://com.apple.objectivec/documentation/ObjectiveC>) 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.
  • Protocol

Protocols

  • NSObjectProtocol: 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 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 *byte, size uintptr, alignment uint8, types *byte) bool

Class_addIvar adds a new instance variable to a class.

See: https://developer.apple.com/documentation/ObjectiveC/class_addIvar(_:_:_:_:_:)

func Class_addMethod

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

Class_addMethod adds a new method to a class with a given name and implementation.

See: https://developer.apple.com/documentation/ObjectiveC/class_addMethod(_:_:_:_:)

func Class_addProperty

func Class_addProperty(cls objc.Class, name *byte, attributes *Objc_property_attribute_t, attributeCount uint) bool

Class_addProperty adds a property to a class.

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.

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.

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.

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.

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.

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.

See: https://developer.apple.com/documentation/ObjectiveC/class_getName(_:)

func Class_getProperty

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

Class_getProperty returns a property with a given name of a given class.

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.

See: https://developer.apple.com/documentation/ObjectiveC/class_getSuperclass(_:)

func Class_getVersion

func Class_getVersion(cls objc.Class) int

Class_getVersion returns the version number of a class definition.

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.

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.

See: https://developer.apple.com/documentation/ObjectiveC/class_isMetaClass(_:)

func Class_replaceProperty

func Class_replaceProperty(cls objc.Class, name *byte, attributes *Objc_property_attribute_t, attributeCount uint)

Class_replaceProperty replace a property of a class.

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.

See: https://developer.apple.com/documentation/ObjectiveC/class_respondsToSelector(_:_:)

func Class_setIvarLayout

func Class_setIvarLayout(cls objc.Class, layout *uint8)

Class_setIvarLayout sets the Ivar layout for a given class.

See: https://developer.apple.com/documentation/ObjectiveC/class_setIvarLayout(_:_:)

func Class_setVersion

func Class_setVersion(cls objc.Class, version int)

Class_setVersion sets the version number of a class definition.

See: https://developer.apple.com/documentation/ObjectiveC/class_setVersion(_:_:)

func Class_setWeakIvarLayout

func Class_setWeakIvarLayout(cls objc.Class, layout *uint8)

Class_setWeakIvarLayout sets the layout for weak [Ivar]s for a given class.

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.

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.

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.

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.

See: https://developer.apple.com/documentation/ObjectiveC/ivar_getTypeEncoding(_:)

func Method_copyArgumentType

func Method_copyArgumentType(m Method, index uint) *byte

Method_copyArgumentType returns a string describing a single parameter type of a method.

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.

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.

See: https://developer.apple.com/documentation/ObjectiveC/method_exchangeImplementations(_:_:)

func Method_getArgumentType

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

Method_getArgumentType returns by reference a string describing a single parameter type of a method.

See: https://developer.apple.com/documentation/ObjectiveC/method_getArgumentType(_:_:_:_:)

func Method_getNumberOfArguments

func Method_getNumberOfArguments(m Method) uint

Method_getNumberOfArguments returns the number of arguments accepted by a method.

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.

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.

See: https://developer.apple.com/documentation/ObjectiveC/method_getTypeEncoding(_:)

func Method_invoke

func Method_invoke()

Method_invoke calls the implementation of a specified method.

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

func NXCompareHashTables

func NXCompareHashTables(table1 *NXHashTable, table2 *NXHashTable) bool

NXCompareHashTables.

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

func Objc_allocateClassPair

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

Objc_allocateClassPair creates a new class and metaclass.

See: https://developer.apple.com/documentation/ObjectiveC/objc_allocateClassPair(_:_:_:)

func Objc_copyClassList

func Objc_copyClassList(outCount *uint) objc.Class

Objc_copyClassList creates and returns a list of pointers to all registered class definitions.

See: https://developer.apple.com/documentation/ObjectiveC/objc_copyClassList(_:)

func Objc_copyClassNamesForImage

func Objc_copyClassNamesForImage(image *byte, outCount *uint) *byte

Objc_copyClassNamesForImage returns the names of all the classes within a specified library or framework.

See: https://developer.apple.com/documentation/ObjectiveC/objc_copyClassNamesForImage(_:_:)

func Objc_copyImageNames

func Objc_copyImageNames(outCount *uint) *byte

Objc_copyImageNames returns the names of all the loaded Objective-C frameworks and dynamic libraries.

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.

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.

See: https://developer.apple.com/documentation/ObjectiveC/objc_disposeClassPair(_:)

func Objc_duplicateClass

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

Objc_duplicateClass used by Foundation’s Key-Value Observing.

See: https://developer.apple.com/documentation/ObjectiveC/objc_duplicateClass(_:_:_:)

func Objc_enumerateClasses

func Objc_enumerateClasses(image unsafe.Pointer, namePrefix *byte, conformingTo **Protocol, subclassing objc.Class)

Objc_enumerateClasses.

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.

See: https://developer.apple.com/documentation/ObjectiveC/objc_enumerationMutation(_:)

func Objc_exception_rethrow

func Objc_exception_rethrow()

Objc_exception_rethrow.

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.

See: https://developer.apple.com/documentation/ObjectiveC/objc_exception_throw(_:)

func Objc_getClassList

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

Objc_getClassList obtains the list of registered class definitions.

See: https://developer.apple.com/documentation/ObjectiveC/objc_getClassList(_:_:)

func Objc_getFutureClass

func Objc_getFutureClass(name *byte) objc.Class

Objc_getFutureClass used by CoreFoundation’s toll-free bridging.

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

func Objc_getRequiredClass

func Objc_getRequiredClass(name *byte) objc.Class

Objc_getRequiredClass returns the class definition of a specified class.

See: https://developer.apple.com/documentation/ObjectiveC/objc_getRequiredClass(_:)

func Objc_lookUpClass

func Objc_lookUpClass(name *byte) objc.Class

Objc_lookUpClass returns the class definition of a specified class.

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.

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.

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(_:_:_:).

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.

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.

See: https://developer.apple.com/documentation/ObjectiveC/objc_removeAssociatedObjects(_:)

func Objc_removeExceptionHandler

func Objc_removeExceptionHandler(token uintptr)

Objc_removeExceptionHandler.

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 uintptr)

Objc_setAssociatedObject sets an associated value for a given object using a given key and association policy.

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.

See: https://developer.apple.com/documentation/ObjectiveC/objc_setEnumerationMutationHandler(_:)

func Objc_setForwardHandler

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

Objc_setForwardHandler set the function to be called by objc_msgForward.

See: https://developer.apple.com/documentation/ObjectiveC/objc_setForwardHandler(_:_:)

func Objc_sync_enter

func Objc_sync_enter(obj Object) int

Objc_sync_enter begin synchronizing on ‘obj’.

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

func Objc_sync_exit

func Objc_sync_exit(obj Object) int

Objc_sync_exit end synchronizing on ‘obj’.

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

func Object_getClass

func Object_getClass(obj Object) objc.Class

Object_getClass returns the class of an object.

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.

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.

See: https://developer.apple.com/documentation/ObjectiveC/object_getIndexedIvars(_:)

func Object_setClass

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

Object_setClass sets the class of an object.

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.

See: https://developer.apple.com/documentation/ObjectiveC/object_setIvar(_:_:_:)

func Object_setIvarWithStrongDefault

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

Object_setIvarWithStrongDefault.

See: https://developer.apple.com/documentation/ObjectiveC/object_setIvarWithStrongDefault(_:_:_:)

func Property_copyAttributeValue

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

Property_copyAttributeValue returns the value of a property attribute given the attribute name.

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.

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.

See: https://developer.apple.com/documentation/ObjectiveC/property_getName(_:)

func Protocol_addMethodDescription

func Protocol_addMethodDescription(proto **Protocol, name SEL, types *byte, isRequiredMethod bool, isInstanceMethod bool)

Protocol_addMethodDescription adds a method to a protocol.

See: https://developer.apple.com/documentation/ObjectiveC/protocol_addMethodDescription(_:_:_:_:_:)

func Protocol_addProperty

func Protocol_addProperty(proto **Protocol, name *byte, attributes *Objc_property_attribute_t, attributeCount uint, isRequiredProperty bool, isInstanceProperty bool)

Protocol_addProperty adds a property to a protocol that is under construction.

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.

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.

See: https://developer.apple.com/documentation/ObjectiveC/protocol_conformsToProtocol(_:_:)

func Protocol_getMethodDescription

func Protocol_getMethodDescription(proto **Protocol, aSel SEL, isRequiredMethod bool, isInstanceMethod bool) unsafe.Pointer

Protocol_getMethodDescription returns a method description structure for a specified method of a given protocol.

See: https://developer.apple.com/documentation/ObjectiveC/protocol_getMethodDescription(_:_:_:_:)

func Protocol_getName

func Protocol_getName(proto **Protocol) *byte

Protocol_getName returns the name of a protocol.

See: https://developer.apple.com/documentation/ObjectiveC/protocol_getName(_:)

func Protocol_getProperty

func Protocol_getProperty(proto **Protocol, name *byte, isRequiredProperty bool, isInstanceProperty bool) unsafe.Pointer

Protocol_getProperty returns the specified property of a given protocol.

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.

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.

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.

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.

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.

Types

type BOOL

type BOOL = bool

type Category

type Category = uintptr

type Class

type Class = objc.Class

type IMP

type IMP = func()

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.

See: https://developer.apple.com/documentation/ObjectiveC/class_getMethodImplementation(_:_:)

func Class_replaceMethod

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

Class_replaceMethod replaces the implementation of a method for a given class.

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.

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.

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.

See: https://developer.apple.com/documentation/ObjectiveC/method_setImplementation(_:_:)

type IObject

type IObject interface {
	GetID() objc.ID
}

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

type IProtocol

type IProtocol interface {
	IObject
}

An interface definition for the Protocol class.

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

type Id

type Id = Object

type Ivar

type Ivar = uintptr

func Class_copyIvarList

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

Class_copyIvarList describes the instance variables declared by a class.

See: https://developer.apple.com/documentation/ObjectiveC/class_copyIvarList(_:_:)

func Class_getClassVariable

func Class_getClassVariable(cls objc.Class, name *byte) Ivar

Class_getClassVariable returns the Ivar for a specified class variable of a given class.

See: https://developer.apple.com/documentation/ObjectiveC/class_getClassVariable(_:_:)

func Class_getInstanceVariable

func Class_getInstanceVariable(cls objc.Class, name *byte) Ivar

Class_getInstanceVariable returns the Ivar for a specified instance variable of a given class.

See: https://developer.apple.com/documentation/ObjectiveC/class_getInstanceVariable(_:_:)

func Object_getInstanceVariable

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

Object_getInstanceVariable obtains the value of an instance variable of a class instance.

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

func Object_setInstanceVariable

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

Object_setInstanceVariable changes the value of an instance variable of a class instance.

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

func Object_setInstanceVariableWithStrongDefault

func Object_setInstanceVariableWithStrongDefault(obj Object, name *byte, value unsafe.Pointer) Ivar

Object_setInstanceVariableWithStrongDefault.

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

type Method

type Method = uintptr

func Class_copyMethodList

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

Class_copyMethodList describes the instance methods implemented by a class.

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.

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.

See: https://developer.apple.com/documentation/ObjectiveC/class_getInstanceMethod(_:_:)

type NSInteger

type NSInteger = int

type NSObject

type NSObject interface {

	// 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

	// Returns the receiver.
	//
	// See: https://developer.apple.com/documentation/ObjectiveC/NSObjectProtocol/self()
	Self() IObject

	// 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 objc.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 objc.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 objc.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 unsafe.Pointer) bool

	// 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

	// Returns a Boolean value that indicates whether the receiver does not descend from [NSObject](<doc://com.apple.objectivec/documentation/ObjectiveC/NSObject-swift.class>).
	//
	// See: https://developer.apple.com/documentation/ObjectiveC/NSObjectProtocol/isProxy()
	IsProxy() bool

	// 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() 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) ConformsToProtocol

func (o NSObjectObject) ConformsToProtocol(aProtocol unsafe.Pointer) bool

func (NSObjectObject) DebugDescription

func (o NSObjectObject) DebugDescription() IObject

func (NSObjectObject) Description

func (o NSObjectObject) Description() IObject

func (NSObjectObject) Hash

func (o NSObjectObject) Hash() uint

func (NSObjectObject) IsEqual

func (o NSObjectObject) IsEqual(object IObject) bool

func (NSObjectObject) IsKindOfClass

func (o NSObjectObject) IsKindOfClass(aClass objc.Class) bool

func (NSObjectObject) IsMemberOfClass

func (o NSObjectObject) IsMemberOfClass(aClass objc.Class) bool

func (NSObjectObject) IsProxy

func (o NSObjectObject) IsProxy() bool

func (NSObjectObject) PerformSelector

func (o NSObjectObject) PerformSelector(aSelector objc.SEL) IObject

func (NSObjectObject) PerformSelectorWithObject

func (o NSObjectObject) PerformSelectorWithObject(aSelector objc.SEL, object IObject) IObject

func (NSObjectObject) PerformSelectorWithObjectWithObject

func (o NSObjectObject) PerformSelectorWithObjectWithObject(aSelector objc.SEL, object1 IObject, object2 IObject) IObject

func (NSObjectObject) Release

func (o NSObjectObject) Release()

func (NSObjectObject) RespondsToSelector

func (o NSObjectObject) RespondsToSelector(aSelector objc.SEL) bool

func (NSObjectObject) Retain

func (o NSObjectObject) Retain() IObject

func (NSObjectObject) Self

func (o NSObjectObject) Self() IObject

func (NSObjectObject) Superclass

func (o NSObjectObject) Superclass() objc.Class

type NSUInteger

type NSUInteger = uint

type NXHashState

type NXHashState struct {
	I int
	J int
}

C struct types NXHashState

[Full Topic] [Full Topic]: https://developer.apple.com/documentation/ObjectiveC/NXHashState

type NXHashTable

type NXHashTable struct {
	Buckets   unsafe.Pointer
	Count     uint
	Info      unsafe.Pointer
	NbBuckets uint
	Prototype *NXHashTablePrototype
}

NXHashTable

[Full Topic] [Full Topic]: https://developer.apple.com/documentation/ObjectiveC/NXHashTable

func NXCreateHashTableFromZone

func NXCreateHashTableFromZone(prototype NXHashTablePrototype, capacity uint, info unsafe.Pointer, zone unsafe.Pointer) *NXHashTable

NXCreateHashTableFromZone.

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

type NXHashTablePrototype

type NXHashTablePrototype struct {
	Free    func(unsafe.Pointer, unsafe.Pointer)
	Hash    func(unsafe.Pointer, unsafe.Pointer) uint
	IsEqual func(unsafe.Pointer, unsafe.Pointer, unsafe.Pointer) int
	Style   int
}

NXHashTablePrototype

[Full Topic] [Full Topic]: https://developer.apple.com/documentation/ObjectiveC/NXHashTablePrototype

type ObjC

type ObjC uint
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 ObjCClearResidentStack

type ObjCClearResidentStack uint
const (
	OBJC_CLEAR_RESIDENT_STACK ObjCClearResidentStack = 1
)

func (ObjCClearResidentStack) String

func (e ObjCClearResidentStack) 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 Objc_AssociationPolicy

type Objc_AssociationPolicy int

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_category

type Objc_category struct{}

type Objc_class

type Objc_class struct{}

type Objc_exception_handler

type Objc_exception_handler = unsafe.Pointer

type Objc_exception_matcher

type Objc_exception_matcher = unsafe.Pointer

type Objc_exception_preprocessor

type Objc_exception_preprocessor = unsafe.Pointer

type Objc_func_loadImage

type Objc_func_loadImage = unsafe.Pointer

type Objc_hook_getClass

type Objc_hook_getClass = unsafe.Pointer

type Objc_hook_getImageName

type Objc_hook_getImageName = string

type Objc_hook_lazyClassNamer

type Objc_hook_lazyClassNamer = unsafe.Pointer

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.

See: https://developer.apple.com/documentation/ObjectiveC/method_getDescription(_:)

func Protocol_copyMethodDescriptionList

func Protocol_copyMethodDescriptionList(proto **Protocol, isRequiredMethod bool, isInstanceMethod bool, outCount *uint) *Objc_method_description

Protocol_copyMethodDescriptionList returns an array of method descriptions of methods meeting a given specification for a given protocol.

See: https://developer.apple.com/documentation/ObjectiveC/protocol_copyMethodDescriptionList(_:_:_:_:)

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_objectptr_t

type Objc_objectptr_t = unsafe.Pointer

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 *uint) *Objc_property_attribute_t

Property_copyAttributeList returns an array of property attributes for a given property.

See: https://developer.apple.com/documentation/ObjectiveC/property_copyAttributeList(_:_:)

type Objc_property_t

type Objc_property_t = unsafe.Pointer

type Objc_selector

type Objc_selector struct{}

type Objc_super

type Objc_super struct {
	Receiver    unsafe.Pointer // A pointer of type [objc_object](<doc://com.apple.objectivec/documentation/ObjectiveC/objc_object>). Specifies an instance of a class.
	Super_class objc.Class     // A pointer to a [Class](<doc://com.apple.objectivec/documentation/ObjectiveC/Class>) data structure. Specifies the particular superclass of the instance to message.

}

Objc_super - Specifies the superclass of an instance.

[Full Topic] [Full Topic]: https://developer.apple.com/documentation/ObjectiveC/objc_super-swift.struct

type Objc_uncaught_exception_handler

type Objc_uncaught_exception_handler = unsafe.Pointer

type Objc_zone_t

type Objc_zone_t = uintptr

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.

See: https://developer.apple.com/documentation/ObjectiveC/class_createInstance(_:_:)

func Class_createInstanceFromZone

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

Class_createInstanceFromZone.

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(_:).

See: https://developer.apple.com/documentation/ObjectiveC/imp_getBlock(_:)

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.

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.

See: https://developer.apple.com/documentation/ObjectiveC/objc_getAssociatedObject(_:_:)

func Objc_getClass

func Objc_getClass(name *byte) Object

Objc_getClass returns the class definition of a specified class.

See: https://developer.apple.com/documentation/ObjectiveC/objc_getClass(_:)

func Objc_getMetaClass

func Objc_getMetaClass(name *byte) Object

Objc_getMetaClass returns the metaclass definition of a specified class.

See: https://developer.apple.com/documentation/ObjectiveC/objc_getMetaClass(_:)

func Objc_loadWeak

func Objc_loadWeak(location uintptr) Object

Objc_loadWeak loads the object referenced by a weak pointer and returns it.

See: https://developer.apple.com/documentation/ObjectiveC/objc_loadWeak(_:)

func Objc_storeWeak

func Objc_storeWeak(location uintptr, obj Object) Object

Objc_storeWeak stores a new value in a `__weak` variable.

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.

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

func Object_copyFromZone

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

Object_copyFromZone.

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.

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.

See: https://developer.apple.com/documentation/ObjectiveC/object_getIvar(_:_:)

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 struct {
	Object
}

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

func Class_copyProtocolList

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

Class_copyProtocolList describes the protocols adopted by a class.

See: https://developer.apple.com/documentation/ObjectiveC/class_copyProtocolList(_:_:)

func NewProtocol

func NewProtocol() Protocol

NewProtocol creates a new Protocol instance.

func Objc_allocateProtocol

func Objc_allocateProtocol(name *byte) **Protocol

Objc_allocateProtocol creates a new protocol instance.

See: https://developer.apple.com/documentation/ObjectiveC/objc_allocateProtocol(_:)

func Objc_copyProtocolList

func Objc_copyProtocolList(outCount *uint) **Protocol

Objc_copyProtocolList returns an array of all the protocols known to the runtime.

See: https://developer.apple.com/documentation/ObjectiveC/objc_copyProtocolList(_:)

func Objc_getProtocol

func Objc_getProtocol(name *byte) **Protocol

Objc_getProtocol returns a specified protocol.

See: https://developer.apple.com/documentation/ObjectiveC/objc_getProtocol(_:)

func ProtocolFromID

func ProtocolFromID(id objc.ID) Protocol

ProtocolFromID constructs a Protocol from an objc.ID.

func Protocol_copyProtocolList

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

Protocol_copyProtocolList returns an array of the protocols adopted by a protocol.

See: https://developer.apple.com/documentation/ObjectiveC/protocol_copyProtocolList(_:_:)

func (Protocol) Autorelease

func (p Protocol) Autorelease() Protocol

Autorelease adds the receiver to the current autorelease pool.

func (Protocol) Init

func (p Protocol) Init() Protocol

Init initializes the instance.

type ProtocolClass

type ProtocolClass struct {
	// contains filtered or unexported fields
}

func GetProtocolClass

func GetProtocolClass() ProtocolClass

GetProtocolClass returns the class object for Protocol.

func (ProtocolClass) Alloc

func (pc ProtocolClass) Alloc() Protocol

Alloc allocates memory for a new instance of the class.

type SEL

type SEL = uintptr

func Method_getName

func Method_getName(m Method) SEL

Method_getName returns the name of a method.

See: https://developer.apple.com/documentation/ObjectiveC/method_getName(_:)

func Sel_getUid

func Sel_getUid(str *byte) SEL

Sel_getUid registers a method name with the Objective-C runtime system.

See: https://developer.apple.com/documentation/ObjectiveC/sel_getUid(_:)

func Sel_registerName

func Sel_registerName(str *byte) SEL

Sel_registerName registers a method with the Objective-C runtime system, maps the method name to a selector, and returns the selector value.

See: https://developer.apple.com/documentation/ObjectiveC/sel_registerName(_:)

Jump to

Keyboard shortcuts

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