现在,在SignUpController中,我想使用委托更新QButtonElement的一个标题,在委托方法中我可以从委托中获取值。但是我无法将值设置为此QButtonElement的标题。像这样的代码:
#import <UIKit/UIKit.h>
@interface LoginViewController : QuickDialogController <QuickDialogStyleProvider>
@end
LoginViewController.m
- (void)pushSignUp:(QButtonElement *)buttonElement
{
QRootElement *root = [[QRootElement alloc] initWithJSONFile:@"signUpForm"];
//don't user quick*er allo iniwithroot
SignUpController *loginController = (SignUpController *)[QuickDialogController controllerForRoot:root];
[self.navigationController pushViewController:loginController animated:YES];
}
SignUpController.m
- (void)didGetCity:(City *)acity
{
self.city = acity;
NSLog(@"%@", self.city.city);//shows new york, so it's working.
QButtonElement *locationElement = (QButtonElement *)[self.root elementWithKey:@"location"];
[locationElement setTitle:acity.city]; // the title won't change.
[self.quickDialogTableView reloadCellForElements:locationElement, nil];
}