PDA

View Full Version : Cocoa Java Applications




MacFan26
Apr 12, 2007, 06:49 PM
Am I right that all type of Cocoa Java applications are deprecated? I was going to try to write a small networked Cocoa Java program with Java networking...I don't know if it's a good idea but I don't know Obj-C networking. I've been reading some of the documentation on it, but it's a little confusing, does anyone know anything about this that might be able to explain it differently?



robbieduncan
Apr 13, 2007, 03:07 AM
The Java bridge for Cocoa has been deprecated and will not get updated. None of the new classes/features in Cocoa in 10.4 were added to the bridge and this will continue. At some point in the future a version of OSX will ship without the bridge at all.So you would be better off leaving Java alone if you want to write a single process app.

Networking in Cocoa itself is fairly confusing but you have to remember that you can drop to normal straight C and just use Unix level networking at a C level. There a are numerous socket wrapper classes available that bring this API back up to the Cocoa/ObjC level.

The other option is to write the GUI in Cocoa and have it launch a Java sub-process to do the networking. The two processes would be able to communicate over pipes.

A list of available socket classes is on CocoaDev (http://www.cocoadev.com/index.pl?SocketClasses).

MacFan26
Apr 14, 2007, 08:42 PM
Cool thanks, I was looking at the Apple's documentation on NSConnection and NSPort, but I didn't really get very far, haha, probably because I don't know networking very well.