 |
 |
Cocoa and java
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: May 2002
Status:
Offline
|
|
Hi i am currently learning java. When i am done i want to learn Cocoa. Can I use cocoa with java, or should i learn obj-c? Also what is the difference between them when using cocoa.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: May 2002
Status:
Offline
|
|
You can use Cocoa with Java. It's a bit slower and there is the occasional mysterious problem, but for the most part it works fine.
|
|
[vash:~] banana% killall killall
Terminated
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Aug 2001
Status:
Offline
|
|
You can use Java with Cocoa, but Objective-C is what it Cocoa is designed for. The great advantage of Java is platform independence, and tying it to a platform specific API (Cocoa) sacrifices that advantage. Objective-C is pretty easy to learn (I knew a little C++, and a moderate amount of Java, and I picked it up very quickly). The primary things you'd have to get used to is doing your own memory management and slightly different syntax, like this:
Code:
class MyClass
{
//variables
//methods
}
is equivalent to
Code:
@interface MyClass
{
//variables
}
//methods
@end
and this:
Code:
myObject.myMethod(anObject, anotherObject);
is roughly equivalent to
Code:
[myObject myMethodWithObject:anObject object:anotherObject];
Once you get past the different appearance and having to pay attention to memory management, Objective-C will be very easy. Cocoa will take much longer to learn than Objective-C will.
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Dec 2000
Location: Chicago, Illinois
Status:
Offline
|
|
If you're starting out with Java as your first language or something, I think Cocoa-Java is a good approach. It introduces you to most of the concepts of nib based development using Cocoa while allowing you to get your feet wet in Java. The transition from Java to Objective-C isn't too hard, took me about two weeks to start working fluently, and that was between classes and learning C++ at the same time.
Cocoa-Java has some mysterious problems, and because the Java-ObjectiveC bridge is sort of under documented, the mysteries aren't always resolved very quickly.
Matt Fahrenbacher
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Nov 1999
Location: San Jose, CA, USA
Status:
Offline
|
|
Cocoa-Java has some mysterious problems, and because the Java-ObjectiveC bridge is sort of under documented, the mysteries aren't always resolved very quickly.
I've got a bunch of back-end code in Java and want to build a useful MacOS X UI, and therefore a non-Swing version.
Is there some site with a comprehensive list of those problems involving the bridge and using ObjectiveC objects from Java? Or will I discover as I go?
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|