ryanmcgrath/cacao

Xib file support?

Closed this issue · 5 comments

Hi, I like simple some of the examples. I was hoping to see an example that made use of an xib file.
Also can we have an example that calls NSApplicationMain()?
This is the description of the method from here: https://developer.apple.com/documentation/appkit/1428499-nsapplicationmain

Creates the application, loads the main nib file from the application’s main bundle, and runs the application. You must call this function from the main thread of your application, and you typically call it only once from your application’s main function. Your main function is usually generated automatically by Xcode.

I feel this function is important because it is responsible for loading values from the info.plist file.

So regarding xibs/nibs... I don't use them, haven't touched 'em in close to a decade, and consider them an antipattern. I won't be doing any work to support them.

However, if others want to step up and contribute code for supporting them, I am more than open to incorporating them into the library due to their history as concepts in the ecosystem. So feel free to draft up a PR and I'll take a look. I'll leave this open as a general commentary issue for now.

Regarding loading values from Info.plist - can you be more specific? You should be able to do this regardless of xibs/nibs being a thing.

I find your answer on xib files to be very interesting. I never thought of them as an antipattern. I use them because they are very easy to create. They are as simple as point and click to make. But they do block you from learning how the AppKit framework works.

The Info.plist file provides the operating system with important information about the application. This can include LSMinimumSystemVersion which tells the operating system if the application can run on it.

This page has a lot more information you might find very useful for possible values it can have: https://developer.apple.com/documentation/bundleresources/information_property_list/bundle_configuration?language=objc

I suppose the user could make code that loads the values from Info.plist, but NSApplicationMain() already does this, so I think wrapping this function would be beneficial to everyone.

Well I was hoping that I could use my previous knowledge of how Apple wants us to create applications with a language other than Objective-C. But I see no reason to keep this issue open anymore. Thank you.

I mean, you could, but it's increasingly clear that Apple's position is not nibs/xibs as the future, nor is Objective-C (unfortunately).

I also do not really understand your issue regarding Info.plist values, but ultimately like I said I won't resist pull requests for xib/nib features so feel free should you decide to revisit cacao.