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

2
  • 1
    where are defining these outlets? Have you tried @property(nonatomic, weak) IBOutlet UIView *name to define in your .h file ? Commented Apr 20, 2016 at 22:09
  • They aren't in my .h file, they are inside my .m file, just beneath the @implementation SomeClass inside the brackets { } Commented Apr 20, 2016 at 22:16

1 Answer 1

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]; 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.