• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Conditionally modifying NIBs?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Conditionally modifying NIBs?


  • Subject: Conditionally modifying NIBs?
  • From: Mike Fischer <email@hidden>
  • Date: Wed, 14 May 2008 19:37:31 +0200

Hi!

Given the recent/ongoing discussion about bypassing Interface Builder I have one question/issue for which IB does not seem to provide any solution. Interface Builder and NIBs are nice and have many advantages but I am missing a way to build different versions of nib files depending on Project targets/settings. I'm wondering how others handle this?

Details:
Let's say I have a project which includes a nib N1 which builds a target T1.
Now I want to add a new target T2 which builds a variant of of T1 that adds some elements to nib N1 and removes some others (N2).


I could create a copy of nib N1 and modify it of course. But that has two major drawbacks:
1) Whenever any of the parts of nib N1 and N2 change that are identical in both nibs I have to remember to make the changes in both.
2) This solution does not scale very well when dealing with more than one variant.


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?


Thanks! 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


  • Follow-Ups:
    • Re: Conditionally modifying NIBs?
      • From: Uli Kusterer <email@hidden>
    • Re: Conditionally modifying NIBs?
      • From: "Hamish Allan" <email@hidden>
    • Re: Conditionally modifying NIBs?
      • From: "David Wilson" <email@hidden>
  • Prev by Date: Re: Bypassing Interface Builder
  • Next by Date: messaging the object that allocated an object
  • Previous by thread: A file's icon in daemon?
  • Next by thread: Re: Conditionally modifying NIBs?
  • Index(es):
    • Date
    • Thread