Strategy for varying nib contents for two product variants?
Strategy for varying nib contents for two product variants?
- Subject: Strategy for varying nib contents for two product variants?
- From: Ken Thomases <email@hidden>
- Date: Wed, 20 Feb 2008 17:52:34 -0600
Hi,
I'm hoping you guys have a good suggestion for my predicament.
I have an existing product, call it MyApplication. Now I want to
produce a variant of it, say MyApplication Premium.
I want the user interface of the product to refer to itself by the
proper name. Of course, the application menu in the menu bar should
refer to MyApplication or MyApplication Premium, as appropriate. So
too should many other controls and views, such as elements of the
preferences dialog:
[ ] MyApplication checks the whozit every [x] minutes
[ ] Display the Tip of the Day when MyApplication starts up
To register your trial copy of MyApplication, enter your registration
code: _________
Please wait while MyApplication rebramfipies your hazniffles…
Etc.
Where the UI is already generated by code, it's easy enough to make
all references to the product's name vary based on targets, build
settings, and configurations.
However, I have a number of NIBs with many references to the product
name. Is there a good way to put a "variable" into NIB content, like
to substitute for one word that appears in many different controls
(button titles, text fields, etc.)?
I'm aware of the following approaches, but I'm hoping that there's
something less painful:
* Hook up outlets from File's Owner to every view which is dependent
on the variable. In the owner's awakeFromNib, manually reset the
content of each of those views from whatever value is in the NIB to
the proper value depending on tthe variable. Do this for every NIB
and its owner.
* Use bindings to accomplish much the same thing. For every view
which has a reference to the product name, set up some keypath in the
controller from which that view can obtain its content/title/etc.
Bind the view's content/title/etc. to that keypath.
Are there other approaches to accomplish this? The above strike me
tedious and error-prone. It also greatly reduces the usefulness of
NIBs and IB, since so much of the UI will not be properly viewable or
editable in IB.
Thanks in advance for any advice you can provide.
Cheers,
Ken _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden