Skip navigation.
 
mlRe: Conditionally modifying NIBs?
FROM : Mike Fischer
DATE : Thu May 15 00:25:47 2008

Am 15.05.2008 um 00:07 schrieb Hamish Allan:

> On Wed, May 14, 2008 at 6:37 PM, Mike Fischer 
> <<email_removed>> 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.

Related mailsAuthorDate
mlConditionally modifying NIBs? Mike Fischer May 14, 19:37
mlRe: Conditionally modifying NIBs? David Wilson May 14, 20:11
mlRe: Conditionally modifying NIBs? Mike Fischer May 14, 20:32
mlRe: Conditionally modifying NIBs? Hamish Allan May 15, 00:07
mlRe: Conditionally modifying NIBs? Mike Fischer May 15, 00:25
mlRe: Conditionally modifying NIBs? Hamish Allan May 15, 01:10
mlRe: Conditionally modifying NIBs? Jonathan Hess May 15, 02:20
mlRe: Conditionally modifying NIBs? Mike Fischer May 15, 13:25
mlRe: Conditionally modifying NIBs? Mike Fischer May 15, 13:26
mlRe: Conditionally modifying NIBs? Jonathan Hess May 15, 22:36
mlRe: Conditionally modifying NIBs? Uli Kusterer May 18, 11:14
mlRe: Conditionally modifying NIBs? Mike Fischer May 18, 15:48