ios - Getting error when adding constraint -


i'm trying set constraint on 2 views touch each other this:

enter image description here

i tried setting constraints programmatically:

[self addconstraint:[nslayoutconstraint constraintswithvisualformat:@"[_firstview][_secondview]" options:0 metrics:nil views:nsdictionaryofvariablebindings(_firstview, _secondview)]]; 

but following warning:

incompatible pointer types sending 'nsarray *' parameter of type 'nslayoutconstraint'

what doing wrong?

the addconstraint: method expect single constraint, constraintswithvisualformat: returns nsarray of 0 or more constraints.

try adding s.

[self addconstraints:/*your nslayoutconstraint constraintswithvisualformat: call */]; 

apple's naming conventions can out here. notice constraintswithvisualformat plural while addconstraint: singular (and addconstraints: plural). use these clue in future.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -