On 2019 Jun 19, at 21:35, Kurt Bigler via Cocoa-dev <cocoa-dev@lists.apple.com> 
wrote:

> I would like to be able to traverse the top-level object list in a macOS nib 
> without instantiating the objects.  But I'd like to be able to get at the 
> attributes of each top-level item to decide whether to instantiate it, and 
> then of course to control instantiation on an object-by-object basis based on 
> that.  Is this possible?

Using available API, you must *load* the nib file.  The method 
loadNibNamed(_:owner:topLevelObjects:) will return an array of top level 
objects.  If that is too much “instantiate” for you, then I think the answer to 
your question is “no”, unless you want to reverse-engineer the nib file format, 
then have your app read that file.

I think the correct solution to this problem, if you are trying to reduce 
resource usage, is to put the views or whatever you’re trying to avoid 
instantiating into separate nib files, and only load the nib files you need.
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to