LibSystem - UBogun/Xojo-iosLib GitHub Wiki

This is a module holding constants and methods for LibSystem API C calls and a few system convenience methods. It is used internally by iOSLib classes.

External Methods

dlerror() As CString: Returns the error message of the last libSystem call.

dlopen (framework as SCTring, flags as int32) As Ptr: Tries to open a dynamic framework.

free (value as CString/Ptr): Releases a reserved chunk of memory on C level.

Methods

LoadFramework (Name as Text, opt. suppressException As Boolean = false) As Boolean: Expects only a dynamic Framework name (like "SpriteKit") and tries to load it. Returns a success value or gives an exception on failure if suppressException is False.

MakeException (ErrorText As CFStringRef): A convenience method to create and raise an exception with one method call.

SystemConstantName (name as CFStringRef, FrameworkPath as CFStringRef) As CFStringRef: Returns the system constant name for a constant value and its associated framework path. Tries to load the framework if it is not open.

  • Example: SystemConstantName ("kCAMediaTimingFunctionDefault", "com.Apple.QuartzCore") returns "default" which is the current name for this constant.
    (Almost) Wherever you find constants beginning with a "k", you should derive their real values from this function. They could be subject to change.

Constants

EndOfLine As Text: Returns Text.FromUnicodeCodePoint (13) which is the character code for EndOfLine on iOS.