Re: Writing Cocoa apps w/o using Interface Builder
Re: Writing Cocoa apps w/o using Interface Builder
- Subject: Re: Writing Cocoa apps w/o using Interface Builder
- From: Bill Bumgarner <email@hidden>
- Date: Sat, 30 May 2009 11:17:18 -0700
On May 30, 2009, at 11:09 AM, Gwynne Raskind wrote:
On May 30, 2009, at 1:01 PM, Jonathan Mast wrote:
Everyone,
Could someone please post a "HelloCocoa" equivalent to this Java
program:
<code>
package example;
import javax.swing.*;
public class HelloJava {
public static void main(String[] args) {
JFrame jf = new JFrame();
JPanel jp = new JPanel();
jp.add(new JButton("Hello Java!"));
jf.setContentPane(jp);
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
jf.pack();
jf.setVisible(true);
}
}
</code>
The only this program does is create a window with a clickable
button in
it.
To create HelloCocoa is to spend 30 seconds in Interface Builder
creating a window with a clickable button in it and then another 30
seconds in Xcode writing the action method that prints "Hello
Objective-C!" (or whatever you want).
That *is* the equivalent.
In short, it's much more complex to do a nibless Cocoa app than
whatever the Java equivelant is.
Of course it is. Nibless Cocoa applications are possible, but
hard. For a reason. It isn't the recommended or supported way of
writing a Cocoa application.
(I have seen this particular line of investigation repeated about once
every 3 months for the nearly 20 years that I have been writing Cocoa
code. It is, ultimately, a waste of time.)
b.bum
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden