Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Diddle me Cocoa



Just for fun. I have added a few interpreter like commands to my application. Actually online entry of code and then compile and go, really pretty awkward. But if its pretty basic stuff maybe a quick test. Prior diddlers have include doJava to compile and run java, osascript for AppleScript and rexx for the Regina rexx compiler.
Following recent discussions of the Cocoa Java bridge I tried that for the fun of it. This has no useful bearing on the prior bridge discussions, I
guess making this of value for a limited duration. Unless someone hacked all the Cocoa and Java introspection necessary to keep this working. I'm guessing it utilizes the introspection features of both languages with some JNI thrown in. That not a real educated or real lengthily thought out guess. If anyone cares to speculate more knowledgeably about how the bridge works I might be curious to see it.
Anyhow again for fun. the cocoa diddler. I add a automatic autorelease pool, otherwise even just starting it and ending it immediately gets error messages.


cocoa
Class systemClass = NSClassFromString(@"java.lang.System");
NSLog(@"java.version=%@",[systemClass getProperty:@"java.version"]);
12 Aug 2005 20:08:24,658 INFO - RuntimeExecutable: gcc
12 Aug 2005 20:08:24,660 INFO - -framework
12 Aug 2005 20:08:24,661 INFO - Foundation
12 Aug 2005 20:08:24,661 INFO - -framework
12 Aug 2005 20:08:24,662 INFO - JavaVM
12 Aug 2005 20:08:24,663 INFO - -o
12 Aug 2005 20:08:24,664 INFO - /tmp/bridge
12 Aug 2005 20:08:24,665 INFO - /tmp/bridge57220.m
/tmp/bridge57220.m: In function 'main':
/tmp/bridge57220.m:7: warning: no `+getProperty:' method found
/tmp/bridge57220.m:7: warning: (Messages without a matching method signature
/tmp/bridge57220.m:7: warning: will be assumed to return `id' and accept
/tmp/bridge57220.m:7: warning: `...' as arguments.)
12 Aug 2005 20:08:27,492 INFO - Runner - [2] org.cmdline.cmds.cocoa complete
12 Aug 2005 20:08:27,504 INFO - RuntimeExecutable: /tmp/bridge
2005-08-12 20:08:29.263 bridge[2501] java.version=1.3.1_16
12 Aug 2005 20:08:29,383 INFO - Runner - [2] org.cmdline.cmds.cocoa complete
cocoa: done


Mike Hall        email@hidden
http://www.spacestar.net/users/mikehall
http://sourceforge.net/projects/macnative



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.