2

现在,在 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];
}
4

0 回答 0