Search code examples
iosobjective-c-blocksxlform

Events not triggered in XLForms


I'm using XLForms to build an iOS app. I am having a problem with getting action events. I've tried both block and formSelector but I'm not getting the events.

Here is my code:

 XLFormRowDescriptor * buttonRow = [XLFormRowDescriptor formRowDescriptorWithTag:@"button" rowType:XLFormRowDescriptorTypeButton title:@"Button"];
 [buttonRow.cellConfig setObject:[UIColor colorWithRed:0.0 green:122.0/255.0 blue:1.0 alpha:1.0] forKey:@"textLabel.textColor"];
 buttonRow.action.formSelector = @selector(didTouchURLButton:);
 [section addFormRow:buttonRow];

I did compile/run the sample app with no problems. I can't figure out what the difference is. I'm not using Cocoa Pods but inserted the code into the project.

It almost seems like the delegate isn't being set correctly but even when I make the call self.form.delegate = self, I still don't get the events.

Any ideas?


Solution

  • The problems was I had another method that was picking up the event first:

     -(void)didTouchButton:(XLFormRowDescriptor *)sender
    {
         [self deselectFormRow:sender];
    }