Note that there are some explanatory texts on larger screens.

plurals
  1. POloadNibNamed loads to different IBOutlets?
    primarykey
    data
    text
    <p>I have a very weird problem and has not been able to solve it yet.</p> <p>This class is defined:</p> <pre><code>@interface EngineViewController : UIViewController { } @property (nonatomic,readonly) IBOutlet GameView* vGameView; @property (nonatomic,readonly) IBOutlet MainMenu* vMainMenu; @property (nonatomic,readonly) IBOutlet CountryOverlay* vCountryOverlay; @end </code></pre> <p>In init method I have this code:</p> <pre><code>if (![[NSBundle mainBundle] loadNibNamed:@"EngineViewController" owner:self options:nil]) { NSLog(@"Failed to load menu nib!"); return NO; } // init [self.view addSubview:vMainMenu]; </code></pre> <p>The problem is, that vMainMenu is nil, vGameView is 0x1 and MainMenu class instance is assigned to vCountryOverlay (instead of vMainMenu).</p> <p>Yes, in Xib, I have EngineViewController as File Owner and vMainMenu outlet set to UIView (MainMenu class) + other outlets not set.</p> <p>I am out of ideas what to try. I tried to create an empty xib, set file owner to EngineViewController and set that vMainMenu outlet again. I have also tried to add a new "dummy" outlet property at the beginning. Tried to call loadNibNamed from a different part of the app, always the same.</p> <p>But when I created a new, clean project, new nib, set owner, made a few outlets and did the same it worked just fine.</p> <p>Why would loadNibNamed cause the first outlet to be set to 0x1 and "to offset" others, setting an instance which should be at the current outlet to the next one? Any idea what to try?</p> <p>Thanks a lot!!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload