Steveo
Steveo

Reputation: 2268

What is the XIB deployment target? (OS X and iOS)

My app must run on OS X 10.6 through 10.9. The main window xib has a deployment target of 10.6 (same as the app itself). The main window nib also has the "Full Screen" attribute set to "Primary Window".

Since 10.6 doesn't support NSWindowCollectionBehaviorFullScreenPrimary, XCode 5 expectedly gives the warning Attribute Unavailable. Full Screen behavior on OS X prior to 10.7.

Questions

  1. Can you ignore this warning and build safely for 10.6 without a crash on nib instantiation?
  2. You can remove this warning by setting the xib deployment target to 10.7, but will the nib still run on 10.6? In other words, doesn't a xib deployment target of 10.7 cut off support for 10.6?
  3. The "proper" solution seems to be to keep the deployment target at 10.6, unset the Full Screen attribute in the xib, and instead set it programmatically at runtime if running on 10.7+. Is this how you should always handle situations like this?
  4. Generally, how does OS X fall back when attributes specified in nibs don't exist at runtime? I can't find a straight answer. Thank you.

Upvotes: 2

Views: 1656

Answers (1)

Swift Dev Journal
Swift Dev Journal

Reputation: 20088

The deployment target is the earliest OS version that can load the xib file. To answer Question 2, setting the deployment target to 10.7 cuts off support for 10.6. The nib file will not run on 10.6.

You listed the solution for supporting 10.6 and later in Question 3. I don't have an answer for Question 4.

Upvotes: 0

Related Questions