All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ca.weblite.objc.util.CocoaUtils Maven / Gradle / Ivy

There is a newer version: 1.2
Show newest version
package ca.weblite.objc.util;

import ca.weblite.objc.NSObject;
import static ca.weblite.objc.RuntimeUtils.sel;
import ca.weblite.objc.annotations.Msg;

/**
 * 

CocoaUtils class.

* * @author shannah * @version $Id: $Id * @since 1.1 */ public class CocoaUtils { /** *

dispatch_async.

* * @param r a {@link java.lang.Runnable} object. */ public static void dispatch_async(final Runnable r){ (new NSObject("NSObject"){ @Msg(selector="run", like="NSObject.finalize") public void run(){ r.run(); } }).send("performSelectorOnMainThread:withObject:waitUntilDone:", sel("run"), null, false); } /** *

dispatch_sync.

* * @param r a {@link java.lang.Runnable} object. */ public static void dispatch_sync(final Runnable r){ (new NSObject("NSObject"){ @Msg(selector="run", like="NSObject.finalize") public void run(){ r.run(); } }).send("performSelectorOnMainThread:withObject:waitUntilDone:", sel("run"), null, true); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy