Search code examples
iosobjective-cxlform

XLForm push selector not working and selector options not being saved as string values


I am using the XLForm and have no issues with most of the category types except for the selector option type. I want to have my selector be a push type selector and the option to be saved as a string value.

The push selector type is not working (I changed to XLFormRowDescriptorTypeSelectorAlertView for testing purposes, and it is working).

Right now, the selector is returning 0x15d50f70 (I believe is an object) and I'm getting the following crash *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[XLFormOptionsObject copyWithZone:]: unrecognized selector sent to instance 0x15d50f70

I've tried playing around with the different methods from here http://cocoadocs.org/docsets/XLForm/2.1.0/Classes/XLFormOptionsObject.html and googling around, but I can't figure this out. Thanks in advance!

EDIT: I got the push selector type working by creating a new vc and making a subclass of XLFormOptionsViewController. Still no luck in getting the string value of the option through.


Solution

  • Are you using the displayText method when looking at formValues?

    NSDictionary *formValues = [self.form formValues];    
    NSString* result = [(XLFormOptionsObject*)formValues[someTag] displayText];