Java源码示例:com.apple.jobjc.foundation.NSAutoreleasePool

示例1
public static void main(String[] args){
    JObjCRuntime.getInstance().registerUserClass(MyDelegate.class, MyDelegateClass.class);

    objc.AppKit().NSApplication().sharedApplication();
    NSApplication app = objc.AppKit().NSApp();

    NSAutoreleasePool pool = objc.Foundation().NSAutoreleasePool().alloc();
    pool = pool.init();
    app.setDelegate(new MyDelegateClass(JObjCRuntime.getInstance()).newID());
    app.run();
    pool.drain();
}
 
示例2
public static void main(String[] args){
    JObjCRuntime.getInstance().registerUserClass(MyDelegate.class, MyDelegateClass.class);

    objc.AppKit().NSApplication().sharedApplication();
    NSApplication app = objc.AppKit().NSApp();

    NSAutoreleasePool pool = objc.Foundation().NSAutoreleasePool().alloc();
    pool = pool.init();
    app.setDelegate(new MyDelegateClass(JObjCRuntime.getInstance()).newID());
    app.run();
    pool.drain();
}
 
示例3
public static void main(String[] args){
    JObjCRuntime.getInstance().registerUserClass(MyDelegate.class, MyDelegateClass.class);

    objc.AppKit().NSApplication().sharedApplication();
    NSApplication app = objc.AppKit().NSApp();

    NSAutoreleasePool pool = objc.Foundation().NSAutoreleasePool().alloc();
    pool = pool.init();
    app.setDelegate(new MyDelegateClass(JObjCRuntime.getInstance()).newID());
    app.run();
    pool.drain();
}
 
示例4
public static void main(String[] args){
    JObjCRuntime.getInstance().registerUserClass(MyDelegate.class, MyDelegateClass.class);

    objc.AppKit().NSApplication().sharedApplication();
    NSApplication app = objc.AppKit().NSApp();

    NSAutoreleasePool pool = objc.Foundation().NSAutoreleasePool().alloc();
    pool = pool.init();
    app.setDelegate(new MyDelegateClass(JObjCRuntime.getInstance()).newID());
    app.run();
    pool.drain();
}
 
示例5
public static void main(String[] args){
    JObjCRuntime.getInstance().registerUserClass(MyDelegate.class, MyDelegateClass.class);

    objc.AppKit().NSApplication().sharedApplication();
    NSApplication app = objc.AppKit().NSApp();

    NSAutoreleasePool pool = objc.Foundation().NSAutoreleasePool().alloc();
    pool = pool.init();
    app.setDelegate(new MyDelegateClass(JObjCRuntime.getInstance()).newID());
    app.run();
    pool.drain();
}
 
示例6
public static void main(String[] args){
    JObjCRuntime.getInstance().registerUserClass(MyDelegate.class, MyDelegateClass.class);

    objc.AppKit().NSApplication().sharedApplication();
    NSApplication app = objc.AppKit().NSApp();

    NSAutoreleasePool pool = objc.Foundation().NSAutoreleasePool().alloc();
    pool = pool.init();
    app.setDelegate(new MyDelegateClass(JObjCRuntime.getInstance()).newID());
    app.run();
    pool.drain();
}
 
示例7
public static void main(String[] args){
    JObjCRuntime.getInstance().registerUserClass(MyDelegate.class, MyDelegateClass.class);

    objc.AppKit().NSApplication().sharedApplication();
    NSApplication app = objc.AppKit().NSApp();

    NSAutoreleasePool pool = objc.Foundation().NSAutoreleasePool().alloc();
    pool = pool.init();
    app.setDelegate(new MyDelegateClass(JObjCRuntime.getInstance()).newID());
    app.run();
    pool.drain();
}
 
示例8
public static void main(String[] args){
    JObjCRuntime.getInstance().registerUserClass(MyDelegate.class, MyDelegateClass.class);

    objc.AppKit().NSApplication().sharedApplication();
    NSApplication app = objc.AppKit().NSApp();

    NSAutoreleasePool pool = objc.Foundation().NSAutoreleasePool().alloc();
    pool = pool.init();
    app.setDelegate(new MyDelegateClass(JObjCRuntime.getInstance()).newID());
    app.run();
    pool.drain();
}
 
示例9
public static void main(String[] args){
    JObjCRuntime.getInstance().registerUserClass(MyDelegate.class, MyDelegateClass.class);

    objc.AppKit().NSApplication().sharedApplication();
    NSApplication app = objc.AppKit().NSApp();

    NSAutoreleasePool pool = objc.Foundation().NSAutoreleasePool().alloc();
    pool = pool.init();
    app.setDelegate(new MyDelegateClass(JObjCRuntime.getInstance()).newID());
    app.run();
    pool.drain();
}
 
示例10
public static void main(String[] args){
    JObjCRuntime.getInstance().registerUserClass(MyDelegate.class, MyDelegateClass.class);

    objc.AppKit().NSApplication().sharedApplication();
    NSApplication app = objc.AppKit().NSApp();

    NSAutoreleasePool pool = objc.Foundation().NSAutoreleasePool().alloc();
    pool = pool.init();
    app.setDelegate(new MyDelegateClass(JObjCRuntime.getInstance()).newID());
    app.run();
    pool.drain();
}
 
示例11
public static void main(String[] args){
    JObjCRuntime.getInstance().registerUserClass(MyDelegate.class, MyDelegateClass.class);

    objc.AppKit().NSApplication().sharedApplication();
    NSApplication app = objc.AppKit().NSApp();

    NSAutoreleasePool pool = objc.Foundation().NSAutoreleasePool().alloc();
    pool = pool.init();
    app.setDelegate(new MyDelegateClass(JObjCRuntime.getInstance()).newID());
    app.run();
    pool.drain();
}
 
示例12
public static void main(String[] args){
    JObjCRuntime.getInstance().registerUserClass(MyDelegate.class, MyDelegateClass.class);

    objc.AppKit().NSApplication().sharedApplication();
    NSApplication app = objc.AppKit().NSApp();

    NSAutoreleasePool pool = objc.Foundation().NSAutoreleasePool().alloc();
    pool = pool.init();
    app.setDelegate(new MyDelegateClass(JObjCRuntime.getInstance()).newID());
    app.run();
    pool.drain();
}
 
示例13
@Override public void setUp() throws Exception {
    FoundationFramework foundation = JObjC.getInstance().Foundation();
    pool = foundation.NSAutoreleasePool().alloc();
    pool.init();
}
 
示例14
public void testFrameworks(){
        // First, get an instance of JObjC:
        final JObjC JOBJC = com.apple.jobjc.JObjC.getInstance();

        // It's your gateway to the frameworks.
        final FoundationFramework FND = JOBJC.Foundation();
        final AppKitFramework APP = JOBJC.AppKit();

        // From which you can then access...

        // enums, defines, constants
        int nsmye = FND.NSMaxYEdge();
        boolean debug = FND.NSDebugEnabled();

        // structs
        NSPoint p = FND.makeNSPoint();
        p.setX(3);
        assertEquals(3.0, p.x());

        // C functions
        NSPoint p2 = FND.NSMakePoint(12, 34);
        assertEquals(12.0, p2.x());

        // ... Let's create an AutoreleasePool before we go on
        NSAutoreleasePool pool = ((NSAutoreleasePool) FND.NSAutoreleasePool().alloc()).init();

        // Objective-C classes
        NSStringClass nsc = FND.NSString();

        // class-methods
        NSString nsStringClassDescr = nsc.description();

        // instances
        NSString nsi = ((NSString) FND.NSString().alloc()).init();

        // instance methods
        NSString d = nsi.description();

        // The bridge marshals some types for you, but it doesn't
        // convert between NSString and Java String automatically.
        // For that we use Utils.get().strings().nsString(String)
        // and Utils.get().strings().javaString(NSString);

        assertEquals("NSString", Utils.get().strings().javaString(nsStringClassDescr));

        NSString format = Utils.get().strings().nsString("Foo bar %d baz");

        NSString formatted = ((NSString) FND.NSString().alloc()).initWithFormat(format, 34);
        String jformatted = Utils.get().strings().javaString(formatted);

        assertEquals("Foo bar 34 baz", jformatted);

        // Reveal in Finder
//        NSString file = Utils.get().strings().nsString(
//                "/Applications/Calculator.app/Contents/Resources/Calculator.icns");
//        APP.NSWorkspace().sharedWorkspace()
//           .selectFile_inFileViewerRootedAtPath(file, null);

        pool.drain();
    }
 
示例15
@Override public void setUp() throws Exception {
    FoundationFramework foundation = JObjC.getInstance().Foundation();
    pool = foundation.NSAutoreleasePool().alloc();
    pool.init();
}
 
示例16
public void testFrameworks(){
        // First, get an instance of JObjC:
        final JObjC JOBJC = com.apple.jobjc.JObjC.getInstance();

        // It's your gateway to the frameworks.
        final FoundationFramework FND = JOBJC.Foundation();
        final AppKitFramework APP = JOBJC.AppKit();

        // From which you can then access...

        // enums, defines, constants
        int nsmye = FND.NSMaxYEdge();
        boolean debug = FND.NSDebugEnabled();

        // structs
        NSPoint p = FND.makeNSPoint();
        p.setX(3);
        assertEquals(3.0, p.x());

        // C functions
        NSPoint p2 = FND.NSMakePoint(12, 34);
        assertEquals(12.0, p2.x());

        // ... Let's create an AutoreleasePool before we go on
        NSAutoreleasePool pool = ((NSAutoreleasePool) FND.NSAutoreleasePool().alloc()).init();

        // Objective-C classes
        NSStringClass nsc = FND.NSString();

        // class-methods
        NSString nsStringClassDescr = nsc.description();

        // instances
        NSString nsi = ((NSString) FND.NSString().alloc()).init();

        // instance methods
        NSString d = nsi.description();

        // The bridge marshals some types for you, but it doesn't
        // convert between NSString and Java String automatically.
        // For that we use Utils.get().strings().nsString(String)
        // and Utils.get().strings().javaString(NSString);

        assertEquals("NSString", Utils.get().strings().javaString(nsStringClassDescr));

        NSString format = Utils.get().strings().nsString("Foo bar %d baz");

        NSString formatted = ((NSString) FND.NSString().alloc()).initWithFormat(format, 34);
        String jformatted = Utils.get().strings().javaString(formatted);

        assertEquals("Foo bar 34 baz", jformatted);

        // Reveal in Finder
//        NSString file = Utils.get().strings().nsString(
//                "/Applications/Calculator.app/Contents/Resources/Calculator.icns");
//        APP.NSWorkspace().sharedWorkspace()
//           .selectFile_inFileViewerRootedAtPath(file, null);

        pool.drain();
    }
 
示例17
@Override public void setUp() throws Exception {
    FoundationFramework foundation = JObjC.getInstance().Foundation();
    pool = foundation.NSAutoreleasePool().alloc();
    pool.init();
}
 
示例18
public void testFrameworks(){
        // First, get an instance of JObjC:
        final JObjC JOBJC = com.apple.jobjc.JObjC.getInstance();

        // It's your gateway to the frameworks.
        final FoundationFramework FND = JOBJC.Foundation();
        final AppKitFramework APP = JOBJC.AppKit();

        // From which you can then access...

        // enums, defines, constants
        int nsmye = FND.NSMaxYEdge();
        boolean debug = FND.NSDebugEnabled();

        // structs
        NSPoint p = FND.makeNSPoint();
        p.setX(3);
        assertEquals(3.0, p.x());

        // C functions
        NSPoint p2 = FND.NSMakePoint(12, 34);
        assertEquals(12.0, p2.x());

        // ... Let's create an AutoreleasePool before we go on
        NSAutoreleasePool pool = ((NSAutoreleasePool) FND.NSAutoreleasePool().alloc()).init();

        // Objective-C classes
        NSStringClass nsc = FND.NSString();

        // class-methods
        NSString nsStringClassDescr = nsc.description();

        // instances
        NSString nsi = ((NSString) FND.NSString().alloc()).init();

        // instance methods
        NSString d = nsi.description();

        // The bridge marshals some types for you, but it doesn't
        // convert between NSString and Java String automatically.
        // For that we use Utils.get().strings().nsString(String)
        // and Utils.get().strings().javaString(NSString);

        assertEquals("NSString", Utils.get().strings().javaString(nsStringClassDescr));

        NSString format = Utils.get().strings().nsString("Foo bar %d baz");

        NSString formatted = ((NSString) FND.NSString().alloc()).initWithFormat(format, 34);
        String jformatted = Utils.get().strings().javaString(formatted);

        assertEquals("Foo bar 34 baz", jformatted);

        // Reveal in Finder
//        NSString file = Utils.get().strings().nsString(
//                "/Applications/Calculator.app/Contents/Resources/Calculator.icns");
//        APP.NSWorkspace().sharedWorkspace()
//           .selectFile_inFileViewerRootedAtPath(file, null);

        pool.drain();
    }
 
示例19
@Override public void setUp() throws Exception {
    FoundationFramework foundation = JObjC.getInstance().Foundation();
    pool = foundation.NSAutoreleasePool().alloc();
    pool.init();
}
 
示例20
public void testFrameworks(){
        // First, get an instance of JObjC:
        final JObjC JOBJC = com.apple.jobjc.JObjC.getInstance();

        // It's your gateway to the frameworks.
        final FoundationFramework FND = JOBJC.Foundation();
        final AppKitFramework APP = JOBJC.AppKit();

        // From which you can then access...

        // enums, defines, constants
        int nsmye = FND.NSMaxYEdge();
        boolean debug = FND.NSDebugEnabled();

        // structs
        NSPoint p = FND.makeNSPoint();
        p.setX(3);
        assertEquals(3.0, p.x());

        // C functions
        NSPoint p2 = FND.NSMakePoint(12, 34);
        assertEquals(12.0, p2.x());

        // ... Let's create an AutoreleasePool before we go on
        NSAutoreleasePool pool = ((NSAutoreleasePool) FND.NSAutoreleasePool().alloc()).init();

        // Objective-C classes
        NSStringClass nsc = FND.NSString();

        // class-methods
        NSString nsStringClassDescr = nsc.description();

        // instances
        NSString nsi = ((NSString) FND.NSString().alloc()).init();

        // instance methods
        NSString d = nsi.description();

        // The bridge marshals some types for you, but it doesn't
        // convert between NSString and Java String automatically.
        // For that we use Utils.get().strings().nsString(String)
        // and Utils.get().strings().javaString(NSString);

        assertEquals("NSString", Utils.get().strings().javaString(nsStringClassDescr));

        NSString format = Utils.get().strings().nsString("Foo bar %d baz");

        NSString formatted = ((NSString) FND.NSString().alloc()).initWithFormat(format, 34);
        String jformatted = Utils.get().strings().javaString(formatted);

        assertEquals("Foo bar 34 baz", jformatted);

        // Reveal in Finder
//        NSString file = Utils.get().strings().nsString(
//                "/Applications/Calculator.app/Contents/Resources/Calculator.icns");
//        APP.NSWorkspace().sharedWorkspace()
//           .selectFile_inFileViewerRootedAtPath(file, null);

        pool.drain();
    }
 
示例21
@Override public void setUp() throws Exception {
    FoundationFramework foundation = JObjC.getInstance().Foundation();
    pool = foundation.NSAutoreleasePool().alloc();
    pool.init();
}
 
示例22
public void testFrameworks(){
        // First, get an instance of JObjC:
        final JObjC JOBJC = com.apple.jobjc.JObjC.getInstance();

        // It's your gateway to the frameworks.
        final FoundationFramework FND = JOBJC.Foundation();
        final AppKitFramework APP = JOBJC.AppKit();

        // From which you can then access...

        // enums, defines, constants
        int nsmye = FND.NSMaxYEdge();
        boolean debug = FND.NSDebugEnabled();

        // structs
        NSPoint p = FND.makeNSPoint();
        p.setX(3);
        assertEquals(3.0, p.x());

        // C functions
        NSPoint p2 = FND.NSMakePoint(12, 34);
        assertEquals(12.0, p2.x());

        // ... Let's create an AutoreleasePool before we go on
        NSAutoreleasePool pool = ((NSAutoreleasePool) FND.NSAutoreleasePool().alloc()).init();

        // Objective-C classes
        NSStringClass nsc = FND.NSString();

        // class-methods
        NSString nsStringClassDescr = nsc.description();

        // instances
        NSString nsi = ((NSString) FND.NSString().alloc()).init();

        // instance methods
        NSString d = nsi.description();

        // The bridge marshals some types for you, but it doesn't
        // convert between NSString and Java String automatically.
        // For that we use Utils.get().strings().nsString(String)
        // and Utils.get().strings().javaString(NSString);

        assertEquals("NSString", Utils.get().strings().javaString(nsStringClassDescr));

        NSString format = Utils.get().strings().nsString("Foo bar %d baz");

        NSString formatted = ((NSString) FND.NSString().alloc()).initWithFormat(format, 34);
        String jformatted = Utils.get().strings().javaString(formatted);

        assertEquals("Foo bar 34 baz", jformatted);

        // Reveal in Finder
//        NSString file = Utils.get().strings().nsString(
//                "/Applications/Calculator.app/Contents/Resources/Calculator.icns");
//        APP.NSWorkspace().sharedWorkspace()
//           .selectFile_inFileViewerRootedAtPath(file, null);

        pool.drain();
    }
 
示例23
@Override public void setUp() throws Exception {
    FoundationFramework foundation = JObjC.getInstance().Foundation();
    pool = foundation.NSAutoreleasePool().alloc();
    pool.init();
}
 
示例24
public void testFrameworks(){
        // First, get an instance of JObjC:
        final JObjC JOBJC = com.apple.jobjc.JObjC.getInstance();

        // It's your gateway to the frameworks.
        final FoundationFramework FND = JOBJC.Foundation();
        final AppKitFramework APP = JOBJC.AppKit();

        // From which you can then access...

        // enums, defines, constants
        int nsmye = FND.NSMaxYEdge();
        boolean debug = FND.NSDebugEnabled();

        // structs
        NSPoint p = FND.makeNSPoint();
        p.setX(3);
        assertEquals(3.0, p.x());

        // C functions
        NSPoint p2 = FND.NSMakePoint(12, 34);
        assertEquals(12.0, p2.x());

        // ... Let's create an AutoreleasePool before we go on
        NSAutoreleasePool pool = ((NSAutoreleasePool) FND.NSAutoreleasePool().alloc()).init();

        // Objective-C classes
        NSStringClass nsc = FND.NSString();

        // class-methods
        NSString nsStringClassDescr = nsc.description();

        // instances
        NSString nsi = ((NSString) FND.NSString().alloc()).init();

        // instance methods
        NSString d = nsi.description();

        // The bridge marshals some types for you, but it doesn't
        // convert between NSString and Java String automatically.
        // For that we use Utils.get().strings().nsString(String)
        // and Utils.get().strings().javaString(NSString);

        assertEquals("NSString", Utils.get().strings().javaString(nsStringClassDescr));

        NSString format = Utils.get().strings().nsString("Foo bar %d baz");

        NSString formatted = ((NSString) FND.NSString().alloc()).initWithFormat(format, 34);
        String jformatted = Utils.get().strings().javaString(formatted);

        assertEquals("Foo bar 34 baz", jformatted);

        // Reveal in Finder
//        NSString file = Utils.get().strings().nsString(
//                "/Applications/Calculator.app/Contents/Resources/Calculator.icns");
//        APP.NSWorkspace().sharedWorkspace()
//           .selectFile_inFileViewerRootedAtPath(file, null);

        pool.drain();
    }
 
示例25
@Override public void setUp() throws Exception {
    FoundationFramework foundation = JObjC.getInstance().Foundation();
    pool = foundation.NSAutoreleasePool().alloc();
    pool.init();
}
 
示例26
public void testFrameworks(){
        // First, get an instance of JObjC:
        final JObjC JOBJC = com.apple.jobjc.JObjC.getInstance();

        // It's your gateway to the frameworks.
        final FoundationFramework FND = JOBJC.Foundation();
        final AppKitFramework APP = JOBJC.AppKit();

        // From which you can then access...

        // enums, defines, constants
        int nsmye = FND.NSMaxYEdge();
        boolean debug = FND.NSDebugEnabled();

        // structs
        NSPoint p = FND.makeNSPoint();
        p.setX(3);
        assertEquals(3.0, p.x());

        // C functions
        NSPoint p2 = FND.NSMakePoint(12, 34);
        assertEquals(12.0, p2.x());

        // ... Let's create an AutoreleasePool before we go on
        NSAutoreleasePool pool = ((NSAutoreleasePool) FND.NSAutoreleasePool().alloc()).init();

        // Objective-C classes
        NSStringClass nsc = FND.NSString();

        // class-methods
        NSString nsStringClassDescr = nsc.description();

        // instances
        NSString nsi = ((NSString) FND.NSString().alloc()).init();

        // instance methods
        NSString d = nsi.description();

        // The bridge marshals some types for you, but it doesn't
        // convert between NSString and Java String automatically.
        // For that we use Utils.get().strings().nsString(String)
        // and Utils.get().strings().javaString(NSString);

        assertEquals("NSString", Utils.get().strings().javaString(nsStringClassDescr));

        NSString format = Utils.get().strings().nsString("Foo bar %d baz");

        NSString formatted = ((NSString) FND.NSString().alloc()).initWithFormat(format, 34);
        String jformatted = Utils.get().strings().javaString(formatted);

        assertEquals("Foo bar 34 baz", jformatted);

        // Reveal in Finder
//        NSString file = Utils.get().strings().nsString(
//                "/Applications/Calculator.app/Contents/Resources/Calculator.icns");
//        APP.NSWorkspace().sharedWorkspace()
//           .selectFile_inFileViewerRootedAtPath(file, null);

        pool.drain();
    }
 
示例27
@Override public void setUp() throws Exception {
    FoundationFramework foundation = JObjC.getInstance().Foundation();
    pool = foundation.NSAutoreleasePool().alloc();
    pool.init();
}
 
示例28
public void testFrameworks(){
        // First, get an instance of JObjC:
        final JObjC JOBJC = com.apple.jobjc.JObjC.getInstance();

        // It's your gateway to the frameworks.
        final FoundationFramework FND = JOBJC.Foundation();
        final AppKitFramework APP = JOBJC.AppKit();

        // From which you can then access...

        // enums, defines, constants
        int nsmye = FND.NSMaxYEdge();
        boolean debug = FND.NSDebugEnabled();

        // structs
        NSPoint p = FND.makeNSPoint();
        p.setX(3);
        assertEquals(3.0, p.x());

        // C functions
        NSPoint p2 = FND.NSMakePoint(12, 34);
        assertEquals(12.0, p2.x());

        // ... Let's create an AutoreleasePool before we go on
        NSAutoreleasePool pool = ((NSAutoreleasePool) FND.NSAutoreleasePool().alloc()).init();

        // Objective-C classes
        NSStringClass nsc = FND.NSString();

        // class-methods
        NSString nsStringClassDescr = nsc.description();

        // instances
        NSString nsi = ((NSString) FND.NSString().alloc()).init();

        // instance methods
        NSString d = nsi.description();

        // The bridge marshals some types for you, but it doesn't
        // convert between NSString and Java String automatically.
        // For that we use Utils.get().strings().nsString(String)
        // and Utils.get().strings().javaString(NSString);

        assertEquals("NSString", Utils.get().strings().javaString(nsStringClassDescr));

        NSString format = Utils.get().strings().nsString("Foo bar %d baz");

        NSString formatted = ((NSString) FND.NSString().alloc()).initWithFormat(format, 34);
        String jformatted = Utils.get().strings().javaString(formatted);

        assertEquals("Foo bar 34 baz", jformatted);

        // Reveal in Finder
//        NSString file = Utils.get().strings().nsString(
//                "/Applications/Calculator.app/Contents/Resources/Calculator.icns");
//        APP.NSWorkspace().sharedWorkspace()
//           .selectFile_inFileViewerRootedAtPath(file, null);

        pool.drain();
    }
 
示例29
@Override public void setUp() throws Exception {
    FoundationFramework foundation = JObjC.getInstance().Foundation();
    pool = foundation.NSAutoreleasePool().alloc();
    pool.init();
}
 
示例30
public void testFrameworks(){
        // First, get an instance of JObjC:
        final JObjC JOBJC = com.apple.jobjc.JObjC.getInstance();

        // It's your gateway to the frameworks.
        final FoundationFramework FND = JOBJC.Foundation();
        final AppKitFramework APP = JOBJC.AppKit();

        // From which you can then access...

        // enums, defines, constants
        int nsmye = FND.NSMaxYEdge();
        boolean debug = FND.NSDebugEnabled();

        // structs
        NSPoint p = FND.makeNSPoint();
        p.setX(3);
        assertEquals(3.0, p.x());

        // C functions
        NSPoint p2 = FND.NSMakePoint(12, 34);
        assertEquals(12.0, p2.x());

        // ... Let's create an AutoreleasePool before we go on
        NSAutoreleasePool pool = ((NSAutoreleasePool) FND.NSAutoreleasePool().alloc()).init();

        // Objective-C classes
        NSStringClass nsc = FND.NSString();

        // class-methods
        NSString nsStringClassDescr = nsc.description();

        // instances
        NSString nsi = ((NSString) FND.NSString().alloc()).init();

        // instance methods
        NSString d = nsi.description();

        // The bridge marshals some types for you, but it doesn't
        // convert between NSString and Java String automatically.
        // For that we use Utils.get().strings().nsString(String)
        // and Utils.get().strings().javaString(NSString);

        assertEquals("NSString", Utils.get().strings().javaString(nsStringClassDescr));

        NSString format = Utils.get().strings().nsString("Foo bar %d baz");

        NSString formatted = ((NSString) FND.NSString().alloc()).initWithFormat(format, 34);
        String jformatted = Utils.get().strings().javaString(formatted);

        assertEquals("Foo bar 34 baz", jformatted);

        // Reveal in Finder
//        NSString file = Utils.get().strings().nsString(
//                "/Applications/Calculator.app/Contents/Resources/Calculator.icns");
//        APP.NSWorkspace().sharedWorkspace()
//           .selectFile_inFileViewerRootedAtPath(file, null);

        pool.drain();
    }