-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setting :insert_mode to :button was causing a crash. Here was the issue: This gem was monkey patching sectionOptions to return the Ruby object's `options` instance variable. However, sectionOptions was being called from the Obj-C section initializer (XLFormSectionDescriptor.formSectionWithTitle) BEFORE we were able to set `options` on the ruby object. So it was Why was this only an issue with the :button option? Well: In that Obj-C initializer there's a call to canInsertUsingButton: - https://github.com/xmartlabs/XLForm/blob/master/XLForm/XL/Descriptors/XLFormSectionDescriptor.m#L85 - https://github.com/xmartlabs/XLForm/blob/master/XLForm/XL/Descriptors/XLFormSectionDescriptor.m#L322-L325 That method is a two-part conditional. The first is 'is the insert mode set to button?' and the second is 'do the section options indicate that I can insert'. The second part was where the crash was occurring but it was never getting there because of the first part was evaluating to false. The main change here is to update our `sectionOptions` monkeypatch to use the ruby instance variable options if set but otherwise fallback to the initial value.
- Loading branch information
Showing
4 changed files
with
32 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters