Re: Conditionally modifying NIBs?
Re: Conditionally modifying NIBs?
- Subject: Re: Conditionally modifying NIBs?
- From: Mike Fischer <email@hidden>
- Date: Thu, 15 May 2008 00:25:47 +0200
Am 15.05.2008 um 00:07 schrieb Hamish Allan:
On Wed, May 14, 2008 at 6:37 PM, Mike Fischer
<email@hidden> wrote:
I remember in the very dim past (when MacApp was still a modern
framework
;-) that I had text based resource files (.r) to build the 'View'
resources
(rough analog to nibs) which included preprocessor macros to
control which
parts/features where active. These would be compiled into .rsrc
files using
the current build settings. This mechanism was very flexible when
it came to
building different variants of an application. (I admit though
that the
source was hard to read and edit due to all of the conditional
stuff.)
Is there any way to achieve someting similar in our modern Cocoa/
Xcode/IB
world? How do others handle this problem?
You could use XIB files instead of NIB files, and write a script to
process them as a build step before they are compiled...
Sure, that would be fine.
Do you happen to have the official format description handy?
The only thing I found was this:
XIB files are not human editable
XIB files are the result of writing an in-memory object graph to
disk, by using a custom serialization protocol. Editing XIB files
by hand is not suggested, extremely dangerous, and can lead to
corrupted interfaces
XIB 3.x and NIB 3.x files are not backward compatible for development
There are some features that can only be developed using the XIB
3.x or NIB 3.x formats. Support for these features—such as support
for toolbars, and the promotion of cells to first-class citizens—
either required underlying changes in AppKit to support, or
introduced new content into the document hierarchy that previous
versions of Interface Builder can not handle. Interface Builder 3.0
includes an automatic compatibility check, performed before saving,
which will inform you of items which affect the file format
compatibility.
From <http://developer.apple.com/releasenotes/DeveloperTools/RN-
InterfaceBuilder/index.html>
(I know this can be hacked, and that while verbose it's only xml. But
I'd want my apps building in the next Xcode (sub-)release as well.)
Mike
--
Mike Fischer Softwareentwicklung, EDV-Beratung
Schulung, Vertrieb
Web: <http://homepage.mac.com/mike_fischer/index.html>
Note: I read this list in digest mode!
Send me a private copy for faster responses.
_______________________________________________
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