1

My files owner has 3 outlets, and all of them are nil on viewDidLoad...

__weak IBOutlet UIView *mainImagePlaceholderView;
__weak IBOutlet UILabel *mainImageLabel;
__weak IBOutlet UIView *imageFilmstripPlaceholderView;

These are located in my .m file, ...

@implementation iRpImageViewerViewController
{
    ...
    __weak IBOutlet UIView *mainImagePlaceholderView;
    __weak IBOutlet UILabel *mainImageLabel;
    __weak IBOutlet UIView *imageFilmstripPlaceholderView;
    ...
}
  • My class in question is iRpImageViewerViewController.xib
  • In IB, the 'files owner custom class' is 'iRpImageViewerViewController.m'
  • In IB, the nib 'view custom class' is UIView

Everything shows as hooked up properly. I have cleaned my build folder. I have cleared my derived data folder. I even tried to trick the views into loading by referring to them in the init method and setting their backcolor.

-(void)viewDidLoad
    {
        [super viewDidLoad];

        // Do any additional setup after loading the view from its nib.

        theMainImageGridviewControl = [[IGGridView alloc]initWithFrame:mainImagePlaceholderView.frame style:IGGridViewStyleSingleCellPaging];

        // Set additional properties to configure the grid view
        theMainImageGridviewControl.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
        theMainImageGridviewControl.selectionType = IGGridViewSelectionTypeCell;
        theMainImageGridviewControl.contentInset = UIEdgeInsetsZero;
        theMainImageGridviewControl.allowHorizontalBounce = NO;
        theMainImageGridviewControl.alwaysBounceHorizontal = NO;
        theMainImageGridviewControl.alwaysBounceVertical = NO;

        [mainImagePlaceholderView addSubview:theMainImageGridviewControl];

        // Setting a breakpoint here reveals that all the outlets are nil
        [self addAChildViewController:theFilmstripViewController toViewWithTag:imageFilmstripPlaceholderView.tag];

        [self constructAndConfigurePrimaryImageMarker];

    }

enter image description here

enter image description here

Logicsaurus Rex
  • 3,172
  • 2
  • 18
  • 27

1 Answers1

2

Not sure exactly how you created the XIB and the view controller, but did you try adding the following to the initializer that you calling for the view controller:

self = [super initWithNibName:@"iRpImageViewerViewController" bundle:nil];