In my app, I need to have a splitView
and to be able to insert my own views to the panes.
To that end, in the Interface builder i have created a SplitView
with two dividers (three panes), and added the "Custom Views" that are in those three panes as IBOutlets
to my corresponding view controller. However, when I query the IBOutlets
for their frame/bounds sizes, they are all 0.00000.
Why do the custom views I created in Xcode have 0 size? How can I fix that?
UPD: the code to query the frame/bounds of the panes:
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
self.logList = [[LogListViewController alloc] initWithNibName:LOGLISTXIB bundle:nil];
[self logARect:self.leftPane.bounds withName:@"LeftPane bounds"];
[self logARect:self.leftPane.frame withName:@"LeftPane Frame"];
}
}
- (void) logARect:(NSRect) theFrame withName:(NSString *)name {
NSLog(@"%@ frame: %lf, %lf, %lf, %lf", name, theFrame.origin.x, theFrame.origin.y, theFrame.size.width, theFrame.size.height);
}
UPD2 At the same time, when I access the panes by self.view.subviews[0]
, i get the correct size.