IBOutlets null in awakeFromNib when using size class function

There are many similar questions to this, however I cannot find my exact problem.

I created a xib file where I only posted one UIView

and linked it to my custom class. I've also added some elements like buttons and labels to this view.

Then I create a view like this:

NSArray* viewsInNib = [[NSBundle mainBundle] loadNibNamed:name owner:self options:nil];
view = [viewsInNib objectAtIndex:0];

      

And when I try to process awakeFromNib

:

-(void)awakeFromNib
{
    [super awakeFromNib];
    // outlets are nil here
}

      

I understand that my outputs are zero.

The interesting point is that if I don't use the size classes and switch with the base case (wAny / hAny), this way works, all outputs exist and can be used. However, when I change the class to some other variant of the iphone (wCompact, hAny) and run the app on the iphone device, I can see my components created in custom class size nil

in a method awakeFromNib

and after some delay they are all installed.

It looks like the components that were added to the custom size class are not being used in the method awakeFromNib

, which is rather strange.

I would appreciate it if someone can help me with this issue!

+3


source to share





All Articles