Instantiation of objects in IB

macrumors newbie

I'm trying to achieve loading of custom views from nib files.
I have a nib which contains NSView with some controls on it, custom object of class B which was loaded through classes tab and subsequently instantiated. And a filesOwner set to my custom class A. Class A contains a references to NSView and B and I bind this A's outlets in IB to appropriate objects.
Class A has a method to load itself from nib using loadNibNamedwner: from NSBundle.
The methods returns true which means nib was loaded successfully, but when I try to look at the fields I see that reference to NSView is populated (and I actually use it inside a form to show contents), but the reference to B is always nil.
I've also tried to stick NSObjectController and add another field to A to check if it is a matter of custom class being instantiated, but the result is the same.
Only the NSView instance is created and referenced by fileOwner.
I suggest that B's instance is never created since its init method is never called according to logging and breakpoints.
I think it is quite trivial operation that I'm doing, so I should be missing something in details or conceptually.

Moderator emeritus

thread startermacrumors newbie

Problem is resolved. It turned out really a schoolboy thing.
I renamed nib file at some point in past and forgot to change the name used to load it.
Xcode kept compiled resource somewhere and it was successfully loaded, but it didn't contained appropriate objects.
Once I made clean and build it started to fail when loading nib since stale files were removed by clean.
Once I fixed the nib name in code everything started to work smoothly.
Thanks for the replies, they showed me the right way.

MacRumors attracts a broad audience
of both consumers and professionals interested in
the latest technologies and products. We also boast an active community focused on
purchasing decisions and technical aspects of the iPhone, iPod, iPad, and Mac platforms.