我想将字符串的单个字符转换为整数,向其中添加2,然后将其转换回字符串.因此,A变为C,K变为M等.
我正在尝试定位标签,以便标签的顶部是UIViewController下方的2/3.所以我写了这个约束,但它给了我下面的错误.
NSLayoutConstraint *labelTopConstraint = [NSLayoutConstraint constraintWithItem:self.myLabel
attribute:NSLayoutAttributeTop
relatedBy:NSLayoutRelationGreaterThanOrEqual
toItem:self.view
attribute:NSLayoutAttributeHeight
multiplier:0.66
constant:0];
Run Code Online (Sandbox Code Playgroud)
错误:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException',
reason: '*** +[NSLayoutConstraint
constraintWithItem:attribute:relatedBy:toItem:attribute:multiplier:constant:]:
Invalid pairing of layout attributes'
Run Code Online (Sandbox Code Playgroud)