Re: Minimal cocoa application
Re: Minimal cocoa application
- Subject: Re: Minimal cocoa application
- From: "Stephen Deken" <email@hidden>
- Date: Thu, 8 Mar 2007 10:24:16 -0600
has what you want. Look at the Tiny.m program in chapter 4. (If you
can find a copy - I don't
know if it is still in print.)
A search for 'tiny.m cocoa' turns up the source. It's pretty much
equivalent to what you've got, only using [NSApplication
sharedApplication] instead of NSApplicationLoad(), and adding a run
loop.
I was kind of hoping to make the app "Plain" cocoa, rather than Cocoa
in Carbon. I was hoping there was some simple cocoa startup code
that I could wrap around this, but it appears that this is not the case.
I think you're conflating 'Carbon' and 'C', as well as 'Cocoa' and
'Objective-C'. Carbon and Cocoa are collections of APIs, while C and
Objective-C are languages. You can't have a 'plain Cocoa' application
-- that is, an application that uses only Objective-C classes --
because Objective-C is just a set of extensions to C. Even the most
pure Cocoa application will have a non-Objective-C function called
main(), which gets autogenerated for you by XCode.
All of the Cocoa / Objective-C stuff gets translated into C functions
by the compiler (messages get translated into objc_msgSend and its
peers, methods have their names mangled and become standard C
functions), so really at a fundamental level everything in Cocoa is
just plain C, except with lots of ways to save on typing.
Really, you should just use Interface Builder and its .nibs. On the
backend, all it's doing is serializing your application's UI so that
it can be recreated later. If you do everything manually, you'll
probably wind up making the exact same calls to create all of your
application's UI that IB would do for you, except your code would be a
lot less maintainable.
</soapbox>
--
Stephen Deken
email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden