-1

error comes out when this code run: [ageInputTextFiled mas_makeConstraints:^(MASConstraintMaker *make){}]; I have searched several similar problem to me ,most answer say that masonry is not link to the project successfully , but i load masonry by cocoapods ,and compile is ok. So anyone can help?thanks

LEOliao
  • 1
  • 3
  • 1
    post your code here – SeanChense Sep 12 '16 at 03:29
  • @SeanChense UITextField *ageInputText = [[UITextField alloc]init]; [ageInputText mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(self.ageLabel.mas_right).with.offset(30); make.centerY.equalTo(self.ageLabel.mas_centerY); make.height.equalTo(@44); make.width.equalTo(@120); }]; [self.contentView addSubview:ageInputText]; – LEOliao Sep 12 '16 at 05:09

2 Answers2

0

You need addSubview first then set constraints.

SeanChense
  • 846
  • 8
  • 14
0

well... i found one solution. open other linker flags ,and add "$(inherited)",my project work just fine,error disappear.

But i don't exactly understand how this works.If someone can tell me ,i will appreciate it.

LEOliao
  • 1
  • 3