I have a NIB with two views that I want to use depending on circumstances. I
call one “weatherCell” and one “weatherCellNarrow”.
I register it like this:
- (NSString*)identifierForWeatherCell {
return _narrowView ? @"weatherCellNarrow":@"weatherCell";
}
********
nib = [[NSNib alloc] initWithNibNamed:@"WeatherCell" bundle:nil];
[self.outlineView registerNib:nib forIdentifier:self.identifierForWeatherCell];
********
WeatherCell* weatherCell = [outlineView
makeViewWithIdentifier:self.identifierForWeatherCell owner:nil];
IB images:
<https://www.dropbox.com/s/o8g5y3t7rrf1whs/Screenshot%202016-01-14%2015.33.13.png?dl=0>
<https://www.dropbox.com/s/ll9n526nw7e9pju/Screenshot%202016-01-14%2015.33.28.png?dl=0>
<https://www.dropbox.com/s/yjidhle3lxx2aai/Screenshot%202016-01-14%2015.33.22.png?dl=0>
The problem is that no matter the order of views in IB, the only one that works
is “weatherCell” and not the narrow one - it just comes back nil. Reading the
docs and stack overflow, I can’t seem to get a good answer to if this should
work or not (having multiple cellViews in one NIB). Based on my initial
tests…I’d say no. However the fact that ONE of them does work makes me curious
if anyone else has ever gotten it to work.
_______________________________________________
Cocoa-dev mailing list ([email protected])
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]