Q:

NSInvalidArgumentException', reason: 'Unable to parse constraint format:

NSInvalidArgumentException', reason: 'Unable to parse constraint format:  I am planning to do a dynamic auto layout for a question and answer but I got this error after I do my nslayout constraint.
    UIScrollView *view = self.view;
        NSDictionary *viewDictionary = @{@"view":view,
                                         @"control":control  
        };
        NSArray *horizontalConstraints = [NSLayoutConstraint constraintsWithVisualFormat:@"H:-0-[view]-0-“  options:0  metrics:nil
        views:viewDictionary];

        NSArray *verticalContraints = [NSLayoutConstraint constraintsWithVisualFormat:@"V:-[control]-[view]-"  options:0 metrics:nil
        views:viewDictionary];

        [self.view.superview addConstraints: verticalContraints];
        [self.view addSubview:control];
        [self.view.superview addConstraints:horizontalConstraints];

The error is:

error *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Unable to parse constraint format: 
  Expected a view 
  H:-0-[view]-0- 

A:

Add the control subview to the superview before adding the constraints. That way autolayout can make sense of the constraints being added.
The visual format language expects a '|' character to delimit the edges of the superview. Try this for the horizontal
|-[view]-|

and this for the vertical
V:|-[control]-[view]-|

