nicklockwood / FXForms

[DEPRECATED]
Other
2.93k stars 339 forks source link

reloadData + valueForKeyPath #376

Open Julioacarrettoni opened 9 years ago

Julioacarrettoni commented 9 years ago

This PR fixes 2 things: 1) When assigning a new form to a formController or reassigning the existing one the content doesn't refresh, so a "reloadData" was added just after the form is assigned.

2) When dealing with "multiple choice" fields the app was crashing due to the fact that "valueForKey" was returning the "value" instead of the "field" object inside FXFormOption. Using "valueForKeyPath" and changing the current overriding of "valueForKey" to "valueForUndefinedKey" seems to fix this issue. To reproduce the issue just run the "BasicExample" with the current form, go to Register and select Gender.