Search code examples
iosvalidationxlform

XLForm formValidationErrors for fields with no title displays "(null)"


Right now, for rows without title, "(null)" will be used in the alert for formValidationErrors

Is there a way to 1. hide the title of the row if I set it? OR 2. Make the alert search for the placeholder when title is absent?

It does make sense to use the placeholder in place of the title, since the rows look nicer using placeholders rather than titles.

Any help or suggestion is greatly appreciated! =D


Solution

    1. You can override -(XLFormValidationStatus *) doValidation in XLFormRowDescriptor and set message to returned XLFormValidationStatus;

    2. You can override -(NSArray *)formValidationErrors in XLFormViewController, first NSError description returned is displayed.

    3. You can override -(void)showFormValidationError:(NSError *)error in XLFormViewController and display UIAlertView on your own.

    I do not use it yet (considering currently) but this is how I see it from source code...