Re: Some architecture questions
Re: Some architecture questions
- Subject: Re: Some architecture questions
- From: "Chris Rose" <email@hidden>
- Date: Tue, 14 Aug 2007 12:51:02 -0600
On 8/14/07, Erik Buck <email@hidden> wrote:
> Answers in no particular order:
>
> > 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.
> No problem. Springs and struts in the IB size inspector allow you to set
> this up easily. I could draw you a picture of how to set the springs and
> struts, but I will resist the temptation with ASCII art. Just play around
> with them in test interface mode until they work the way you want. Hit,
> there are only 256 relevant combinations of the horizontal spring and strut
> settings and they are symmetrical on left and right so if you get one side
> right, just use the mirror image on the other side ;)
Feel free to make with the ASCII art; You could also provide me with a bitfield
rep (say, 1: springy, 2: straight?) ;)
> > 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?
> The specific representation of the data model is almost irrelevant. You might consider Core Data, but it is probably too much for your simple needs. The key is to use the Model View Controller design pattern. http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/CocoaDesignPatterns/chapter_5_section_4.html
> http://developer.apple.com/documentation/Cocoa/Conceptual/ObjCTutorial/chapter02/chapter_2_section_3.html
>
I've got the MVC thing more or less nailed down, but it's not clear to me
where, for example, model objects are initialized, to which extent I need to
manipulate those objects in IB vs. XCode, etc. Moreover, I'm interested in
_learning_ core data, so overkill or no I might still want to go that route.
If nothing else, the abstraction of the data layer won't kill me and might
leave room for improvement in the future.
--
Chris R.
======
Not to be taken literally, internally, or seriously.
_______________________________________________
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