Re: Some architecture questions
Re: Some architecture questions
- Subject: Re: Some architecture questions
- From: Steve Israelson <email@hidden>
- Date: Tue, 14 Aug 2007 11:46:43 -0700
1. What is the _right_ way to manage application state data? Suppose,
for example, I want to scan a directory on disk and build a database
of its contents that is, if not static, rarely going to change. I
want to persist this between starts of the app because I anticipate
this taking no small amount of time. Where would I store this? Are
there good tools for doing so built in? And, assuming so, where do I
locate documentation on those that does not presuppose knowledge of
Cocoa/Xcode to do it?
In your application delegate object, manage all this. Store it in
the application support folder like other apps do.
Or in your preferences file.
2. In Interface Builder, I wish to perform some layout tasks that are
stumping me. Specifically, I want to do layout of three components
such that, given these three components:
[----].[++++++].[****]
The left(-) and right(*) components will remain fixed in size, with
the middle(+) enlarging to fit the space in between when the container
grows, but (and this is the part that nails me) the spaces between
them (denoted by '.') do _not_ change size; I want the middle
component to be anchored, not to the edges of the container, but to
its neighboring components.
Find and download RBSplitView and use it.
3. Toolbars. I found this article on how to interact with them
(http://developer.apple.com/documentation/Cocoa/Conceptual/Toolbars/
index.html)
but I can't grok how to build them at all. I think it has something
to do with loading new Nibs, but I'm not completely sure how to do
that, nor am I sure where it should be done.
In your application delegate for a single window app, implement the
toolbar methods that return the item names etc.
Else, in your document class do this if you have document windows.
4. Application lifecycle. I realize that there's a framework sitting
around any app I write, so it behooves me to figure out the right way
to start up, shut down, and manage global state in the application.
My C service apps typically have a mix of an option database
(analogous to the Defaults mechanism, I think) and a global state
structure that is configured at startup to provide operational
information. What is the right way to configure apps in Cocoa? This
is part of a larger question involving the instantiation of classes in
IB (who does it? How to configure them?) and the right place/time to
do all kinds of neat things. Suppose I want to rescan the data I
mentioned above. When should I do that? What class/method is right
for it?
Application delegate. You can implement methods to notify you when
the app starts and quits.
5. Information in general. What I see online for Cocoa development
information seems to be evenly split between information for
specialized tasks that experienced Cocoa developers might use to
enhance an established application and tutorials geared at total
programming newbies. The latter have some minor use to me because
they offer an introduction to the capabilities of the tools (IB still
confuses me, sometimes) but don't answer this type of question at all.
Are there any resources for cocoa geared at people whose programming
skills don't need help, but want to understand the way it all hangs
together, along with examples?
http://www.Amazon.com/
http://www.cocoadev.com/
http://www.cocoadevcentral.com/
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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