I want to use an NSGridView
in a.xib file for a custom view. NSGridView
's are only available on macOS 10.12 and later, but my app runs on macOS 10.11 and later.
So when compiling my application I get an error at the stage, where the.xib files are compiled:
NSGridView before OS X 10.12
What I would want to do is create two separate.xib files, one which is compatible with macOS prior to 10.12 (this would contain an alternative to NSGridView
) and the other one for all above version (this would then use NSGridView
). In the view controller I would load the correct.xib file based on the macOS version with if #available(OSX 10.12, *)
.
The problem is that the project doesn't even compile, when it contains a.xib file with an NSGridView
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.