FXForms
                                
                                 FXForms copied to clipboard
                                
                                    FXForms copied to clipboard
                            
                            
                            
                        Modify title in CustomButtonCell
Hi Nick, I'm working on a CostomButtonCell starting from your example code, I need to modify the Button Title Text and I'm trying to modify it using the FXForms field.title property.
I added the Title property in NSDictionary, modified the CustomButtonCell.m and implemented the method awakeFromNib... But it doesn't work because self.field.title is nil in that point.
Am I wrong?
Thanx in advance. G
Here it is the code:
// // LoginForm.m // BasicExample // // Created by Nick Lockwood on 05/02/2014. // Copyright (c) 2014 Charcoal Design. All rights reserved. //
import "LoginForm.h"
import "CustomButtonCell.h"
@implementation LoginForm
(NSArray *)extraFields { return @[
 //we declare our custom submit buytton cell as normal, but note that
 //we have specified that we want to use our CustomButtonCell class
 //instead of the default FXFormBaseCell
 @{FXFormFieldCell: [CustomButtonCell class], FXFormFieldTitle:@"TEST TITLE", FXFormFieldHeader: @"", FXFormFieldAction: @"submitLoginForm"},
 ];
} @end
import "CustomButtonCell.h"
@interface CustomButtonCell () @property (nonatomic, strong) IBOutlet UIButton *cellButton; @end
@implementation CustomButtonCell
(void)awakeFromNib { [self.cellButton setTitle:self.field.title forState:UIControlStateNormal]; } (IBAction)buttonAction { if (self.field.action) self.field.action(self); }
@end
@brdp how did you solve this issue?
Unfortunately I haven't solved yet... :( I'm working on a different project and we are not using FXForms. :(
If this helps, I was able to change the title directly in the .xib file for the custome button (CustomButtonCell.xib)