ObjC

object ObjC(source)

Helper object for working with Objective-C objects and strings.

Properties

Link copied to clipboard
const val NSNotFound: Long
Link copied to clipboard
const val NSUTF8StringEncoding: Int = 4

Functions

Link copied to clipboard
fun createNSRange(location: Long, length: Long): NSRange

Creates an NSRange structure (location, length).

Link copied to clipboard
fun createNSString(string: String): Pointer?

Creates an NSString from a Kotlin String.

Link copied to clipboard
fun getClass(name: String): Pointer?

Gets a class by name.

Link copied to clipboard
fun msgSend(receiver: Pointer?, selector: Pointer?): Pointer?

Sends a message with no arguments.

fun msgSend(receiver: Pointer?, selector: Pointer?, arg1: Pointer?): Pointer?

Sends a message with one pointer argument.

fun msgSend(receiver: Pointer?, selector: Pointer?, arg1: Long): Pointer?

Sends a message with one long argument.

fun msgSend(receiver: Pointer?, selector: Pointer?, arg1: Pointer?, arg2: Pointer?): Pointer?

Sends a message with two pointer arguments.

fun msgSend(receiver: Pointer?, selector: Pointer?, arg1: Pointer?, arg2: Long): Pointer?

Sends a message with mixed arguments (Pointer, Long). Useful for methods that take an object and an integer/index.

fun msgSend(receiver: Pointer?, selector: Pointer?, arg1: Long, arg2: Long): Pointer?

Sends a message with integer arguments.

fun msgSend(receiver: Pointer?, selector: Pointer?, arg1: Pointer?, arg2: Long, arg3: Long): Pointer?

Sends a message with mixed arguments (Pointer, Long, Long).

Link copied to clipboard
fun nsStringToString(nsString: Pointer?): String?

Converts an NSString to a Kotlin String.

Link copied to clipboard
fun release(obj: Pointer?)

Releases an Objective-C object.

Link copied to clipboard
fun retain(obj: Pointer?): Pointer?

Retains an Objective-C object.

Link copied to clipboard
fun selector(name: String): Pointer?

Registers a selector.