dhawaldawar / TextFieldValidator

MIT License
168 stars 72 forks source link

Exception raised #11

Closed OxMarco closed 9 years ago

OxMarco commented 9 years ago

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Unable to parse constraint format: Unable to interpret '|' character, because the related view doesn't have a superview H:|-0-[popUp]-0-|

tflack commented 9 years ago

Same problem here

dhawaldawar commented 9 years ago

You have to set "presentInView" property with UIView reference, on which you want to show error popup. You can use UITextField superview for this property.

bintu1234 commented 8 years ago

same issue How to set the "presentInView" property with UIView reference?

andrewreeman commented 8 years ago

I was using a subclass of UITableViewCell to hold my TextViewValidator. I wanted to error popup to display in the cell so I did:

class MyCell : UITableViewCell {
    @IBOutlet var m_field: TextFieldValidator!

    func initializeTextFieldValidator(){
        m_field.presentInView = self
    }

}
bintu1234 commented 8 years ago

@andrewreeman Thanks for theReplay but where did i use this method "initializeTextFieldValidator". And when i give my_text.presentInView = self it is showing warning like incompactible pointer type.And Result is same error

andrewreeman commented 8 years ago

"presentInView" should take a UIView type. What class is 'self' in your case? If it is a UIViewController you may have to do something like:

presentInView = self.view

In fact if you take a look at the TextFieldValidatorDemo it seems this is what is done in the FormViewController class.

bintu1234 commented 8 years ago

@andrewreeman Thanks for the replay its working.