Re: cocoa app from scratch
Re: cocoa app from scratch
- Subject: Re: cocoa app from scratch
- From: Public Look <email@hidden>
- Date: Sun, 18 Jul 2004 20:57:46 -0400
First I will express my opinion that you probably don't want what you
think you want:
IB does nothing magic. You can do anything IB does with code, but it
takes more code.
XCode is just an Integrated Development Environment (IDE) that makes
using the gnu command line programs more productive for most people.
You can use the tools from the command line if you prefer.
Interface Builder (IB) deliberate does not generate much source code
for very good reasons.
- First and foremost, the whole point of object oriented programming is
to increase programmer productivity by increasing code reuse. If new
code has to be generated (either by a human or a machine) then propably
an opportunity to reuse existing code is being missed. (Particularly
with repetitive GUI code)
- Every new line of code is a potential bug no matter how it was
generated.
- Most code generation tools do not work well when the generated code
is later (inevitably) hand edited. Either the tool can't reimport the
changes in a sensible way or when the tool generates more code,
expensively written human generated code is lost or broken.
While in IB, you are working with live objects. These are the actual
objects that will be used in your application. The code for the
objects is already in frameworks and it would be redundant and wasteful
to duplicate that code. The objects are archived into data files
called nibs which preserve all of their essential state and
interconnections. When the nib file is loaded either by IB or by your
application, all of the objects are un-archived and all of the
connections restored. The objects continue operating normally.
All of that said, I repeat that IB is doing nothing that you can't do.
It is perfectly possible to write Cocoa programs with any tool set you
want and the command line gnu (or other) tools. This includes writing
your own make files, using gcc or a java compiler or Python or
AppleScript, etc.
There are tutorials on the net for working with Cocoa without IB, but
for most applications, you would be out of your mind to want to do
that. IB is a huge labor saver!
To answer your question from the archives:
http://cocoa.mamasam.com/MACOSXDEV/2003/02/2/57289.php
http://cocoa.mamasam.com/COCOADEV/2002/12/2/52901.php
http://www.cocoabuilder.com/archive/message/cocoa/2004/6/7/109115
Chapter 3 of
(
http://www.oreilly.com/catalog/buildcocoa/index.html?CMP=IL7015)
explains how to create an app only with code (without IB).
http://examples.oreilly.com/buildcocoa/
http://cocoa.mamasam.com/COCOADEV/2003/03/1/57945.php
here is a gnustep sample that should work fine on Mac OS X with Cocoa:
http://www.gnustep.it/nicola/Tutorials/WindowsAndButtons/index.html
On Jul 18, 2004, at 6:31 PM, Ihar 'Philips' Filipau wrote:
>
Hello!
>
>
I was just wondering, is there any way of building cocoa application
>
without Xcode/IB?
>
>
I'm trying to learn this stuff by myself. But I'm not really
>
/visual/ programmer - and I'm getting bored of IB pretty fast. It
>
needs *way* *too* *much* mouse clicking. It's just impossible (*).
>
Most of the tutorials on Internet are just not applicabable to
>
10.3.*'s Xcode/IB due to new names/features. And most of this tutorial
>
are just "click here, then here, then click here, then click here,
>
then here." In the end you are getting something - seems like XML file
>
insode of bundle, which is not that readable/understandable. And you
>
can only hope that this next "click here" exists in my version of IB.
>
As a total newbie it have been proven ver difficult.
>
>
So I'm looking for some sample of Cocoa application (say HelloWorld)
>
which is written without IB.
>
>
Any pointers to FAQs/RTFMs will be appreciated.
>
>
Thanks in advance.
>
>
(*) Yeah, normally I don't use mouse. At all. MacOS itsef user-wise
>
requires much less mouse waiving.
>
>
P.S. I have had some experience with GTK's Glade and Borland's C++
>
Builder. Is there anything like GTK's Glade for Cocoa - what basicly
>
generates source code for given piece of GUI, which one (I'm
>
oversimplifying here) needs to call from main(). I need something I
>
can look into and understand what is going on.
>
_______________________________________________
>
cocoa-dev mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.