Foundation

interface Foundation : Library(source)

JNA bindings for macOS Objective-C runtime and Foundation framework.

This provides low-level access to:

  • Objective-C runtime (objc_* functions)

  • Core Foundation string functions

  • NSObject methods

Reference: https://developer.apple.com/documentation/objectivec/objective-c_runtime

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
abstract fun CFStringCreateWithCString(alloc: Pointer?, cString: String, encoding: Int): Pointer?

Creates an NSString from a UTF-8 C string. Equivalent to: [NSString alloc initWithUTF8String:cString]

Link copied to clipboard
abstract fun CFStringGetCharacters(string: Pointer?, range: Pointer?, buffer: CharArray)

Gets characters from an NSString.

Link copied to clipboard
abstract fun CFStringGetCStringPtr(string: Pointer?, encoding: Int): Pointer?

Creates a Java String from an NSString pointer.

Link copied to clipboard
abstract fun CFStringGetLength(string: Pointer?): Long

Gets the length of an NSString.

Link copied to clipboard
abstract fun objc_getClass(className: String): Pointer?

Gets a class by name.

Link copied to clipboard
abstract fun objc_release(obj: Pointer?)

Releases an Objective-C object (decrements reference count).

Link copied to clipboard
abstract fun objc_retain(obj: Pointer?): Pointer?

Retains an Objective-C object (increments reference count).

Link copied to clipboard
abstract fun sel_registerName(selectorName: String): Pointer?

Registers a selector (method name) and returns a pointer to it.