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
ios objective-c iphone xcode6 xib


source to share


No one has answered this question yet

See similar questions:

8
Accessing the View in awakeFromNib?

or similar:

241
How can I use automatic layout to move other views when the view is hidden?
6
IBOutlets in Nib are null for both awakeFromNib and initWithCoder - no subplots
five
Xcode6: Is there an easy way to copy constraints between size classes?
1
Can I set two different limits for the same UIView based on the size class?
0
Moving custom UIView, submission fails
0
What is the best way to name an XIB file in Xcode 6 using a storyboard?
0
How to add custom subview to derived class UITableViewCell when UITableViewCell is loaded using loadNIB
0
UIView missing background
0
IOS 8 auto detect limitation messed up in different size classes
0
Why is the view class not showing up in the storyboard?



All Articles
Loading...
X
Show
Funny
Dev
Pics