sam*_*n01 2 iphone xcode objective-c ios
在根模型中,我有:
[self.rPrices replaceObjectAtIndex:0
withObject:[NSNumber numberWithFloat:(float)nR4]];
NSLog(@"%.2f", [self.rPrices objectAtIndex:0]);
Run Code Online (Sandbox Code Playgroud)
rPrices在哪里NSMutableArray.
nR4不为零,但上面NSLog(...);显示为零.
谢谢
试试这个
NSLog(@"%.2f", [[self.rPrices objectAtIndex:0] floatValue]);
Run Code Online (Sandbox Code Playgroud)
或者只是将其打印NSNumber为对象
NSLog(@"%@", [self.rPrices objectAtIndex:0]);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
173 次 |
| 最近记录: |