当我尝试访问我的 NSDecimalNumber amount_before_current_year 的任何属性时,我的应用程序崩溃:
[amount_before_current_year stringValue]
Program received signal: “EXC_BAD_ACCESS”.
该对象是一个 NSDecimalNumber,如附图所示。
我在viewDidLoad中创建的,它存在于头文件中:
.h
...
NSDecimalNumber *amount_before_current_year;
...
@property (nonatomic, retain) NSDecimalNumber *amount_before_current_year;
...
也在实现文件中:
@synthesize amount_before_current_year;
amount_before_current_year = [NSDecimalNumber decimalNumberWithString:@"100.00"];
在这里我再次调用它:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
NSString *test = [amount_before_current_year stringValue]; // HARD CRASH !!!
所以,我现在不知道该怎么办,我已经花了几个小时来处理这个......
有任何想法吗 ??????
谢谢,河