error :reason: '-[UITextField mas_makeConstraints:]: unrecognized selector

706 Views Asked by At

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

2

There are 2 best solutions below

1
SeanChense On

You need addSubview first then set constraints.

0
LEOliao On

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.