How to change this code from Java to Kotlin?


#1

Hi,

I’m using Libgdx and robovm. I want to change this below code to Kotlin, Please give me a hand.

public static void main(String[] argv) {
        NSAutoreleasePool pool = new NSAutoreleasePool();
        UIApplication.main(argv, null, IOSLauncher.class);
        pool.close();
    }

#2

Hi,

the following should work:

fun main(argv: Array<String>) {
    val pool = NSAutoreleasePool()
    UIApplication.main(argv, null, IOSLauncher::class.java)
    pool.close()
}

#3

Thank you. I am trying this.