I am about to set up some constraints in my app. When i try to make an NSDictionary
i get the error that tells me that my UITextView
is nil. As you can see i have set some preferences for my UITextView
, so i would presume that it isn't nil. But, if it is nil, how to i make it not nil?
I have also tried the NSDictionaryOfVariableBindings
, without any luck.
Thanks.
UIView *infoView = [[UIView alloc] viewWithTag:1];
infoView.backgroundColor = [UIColor blackColor];
infoView.translatesAutoresizingMaskIntoConstraints = NO;
[displayView addSubview:infoView];
NSDictionary *views = @{@"infoView" : infoView};
[displayView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[infoView]|"
options:0
metrics:nil
views:views]];
[displayView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[infoView]|"
options:0
metrics:nil
views:views]];