objective c - Multiple nibs, multiple IBOutlets, one controller. Getting unrecognized selector? -
I have three nibbles, and there is a SetupController class. In the interface builder, the owner of the file in all the nibs on "SetupController" Has been set.
I have the SetupController header file in the
@property (strong) IBOutlet NSTextField * label; // Nib A (built with SetupController) @ Property (strong) IBOutlet NSTextField * label2; // nib three
In my file with me:
@implementation SetupController @ synthesize label = _label; @ Synthesis label 2 = _label2;
Now, when I try to update NSTextField of label 2, using [_label2 setStringValue: @ "string"], nothing happens, I'm seeing debug open _label2 is zero, but not _label.
The second and third jobs (which I can not update) are being loaded with initWithNibName in a widget controller: @ "NIB" bundle: zero;
Do not load the outlet properly? Since the outlets are immediately in the SetupController, and I am loading new views as a new ViewController, they are not loading properly?
Thanks everyone!
If for those people, the property declaration file is in the owner category of one and three for both, And both the nebes are loaded with similar examples of that class, so maybe they both non-nil. However, a catch-22 is because you say that you are using an init function in an NSViUIUUU controller sub-class to load the niv. And every VC can only be integrated once and manage only one view, not two.
Then the VC example where the label's property is non-zero, should be init-ed with "Nib A". Label 2 is zero because NSTextField is not in "nib one" that you think is an outlet. IBotlets indicate visual objects when the nib load occurs, and there is nothing in the nibb to indicate for label 2.
You should have a label 2 outlet in the VC instance, which is "Nib three." This is usually a different class than VC, which loads the "nib forest", although I do not know That you can not get two nibiyas with the owner class of the same file, depending on the number of zeros with the outlet, depending on the frequency of each VC class load.
Comments
Post a Comment