我有这个代码:
CGRect screenRect = [[UIScreen mainScreen] bounds];
CGFloat screenWidth = screenRect.size.width;
NSLog([NSString stringWithFormat:@"\n%g pixel \n=======================================",screenWidth]);
CGFloat imageWidth = [[self.widthArray objectAtIndex:indexPath.row] floatValue];
NSLog([NSString stringWithFormat:@"\n%f pixel\n=======================================",imageWidth]);
CGFloat ratio = screenWidth / imageWidth;
NSLog([NSString stringWithFormat:@"\nratio is %f\n=======================================",ratio]);
screenWidth
并且imageWidth
非常好,但是当我尝试记录ratio
程序时,它会崩溃并且日志显示(lldb)
。我还没有在任何地方找到解决方案。有什么建议吗?
编辑:
前两个日志是
2015-01-03 08:49:00.888 Huckleberry[6554:158359]
320.000000 pixel
=======================================
2015-01-03 08:49:00.889 Huckleberry[6554:158359]
512.000000 pixel
=======================================
然后ratio
就是(lldb)