
package ${package};

import org.robovm.apple.foundation.NSAutoreleasePool;
import org.robovm.apple.uikit.UIApplication;
import org.robovm.apple.uikit.UIApplicationDelegateAdapter;
import org.robovm.apple.uikit.UIApplicationLaunchOptions;
import org.robovm.apple.uikit.UIScreen;
import org.robovm.apple.uikit.UIWindow;

public class ${mainClass} extends UIApplicationDelegateAdapter {
    private UIWindow window;
    private MyViewController rootViewController;

    @Override
    public boolean didFinishLaunching (UIApplication application, UIApplicationLaunchOptions launchOptions) {
        // Set up the view controller.
        rootViewController = new MyViewController();

        // Create a new window at screen size.
        window = new UIWindow(UIScreen.getMainScreen().getBounds());
        // Set the view controller as the root controller for the window.
        window.setRootViewController(rootViewController);
        // Make the window visible.
        window.makeKeyAndVisible();

        return true;
    }

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

@@ -1077,16 +1077,21 @@
         
+try (
 NSAutore
@@ -1130,26 +1130,26 @@
 sePool()
-;
+) %7B
 %0A    
-    
+%09%09
 UIApplic
@@ -1200,25 +1200,10 @@
     
-  
-  pool.close();
+%09%7D
 %0A   

Use try-with-resource for autoreleasepool in default template main method (#5).