我的模特有
@property (nonatomic, strong) NSDecimalNumber *totalSpent;
当我记录
NSLog(@"totalSpent:%@", self.monthlySummaryModel.totalSpent);
我得到了
2014-12-02 12:59:47.287 app-ios[16741:60b] totalSpent:2037.01
现在我想在UILabel
@property(nonatomic, weak) IBOutlet UILabel *totalSpentLabel;
我将值指定为
self.totalSpentLabel.text = [self.monthlySummaryModel.totalSpent stringValue];
但我在页面上看到的并不是什么
这可能是什么问题?
答案 0 :(得分:0)
问题是数据是从API
获取的,我必须在获取数据后更新标签
self.monthlySummaryModel = [[MonthlySummaryModel alloc] initWithJson:monthlySummary];
NSLog(@"totalSpent:%@", self.monthlySummaryModel.totalSpent);
[self.tableView reloadData];
[self setSummarySpentView];
- (void)setSummarySpentView {
self.SummarySpentView.backgroundColor = [UIColor colorWithRed:44 / 255.0f green:62 / 255.0f blue:80 / 255.0f alpha:1.0f];
self.totalSpentLabel.text = [self.monthlySummaryModel.totalSpent stringValue];
}