Some architecture questions
Some architecture questions
- Subject: Some architecture questions
- From: Erik Buck <email@hidden>
- Date: Tue, 14 Aug 2007 11:35:24 -0700 (PDT)
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 ;)
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
_______________________________________________
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