我有这样的代码:
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)了
发布于 2015-05-22 21:43:14
如果您在控制台中看到(lldb),那么您很可能遇到了断点。如果你自己没有在那里添加断点,那么你的项目中可能会有一个异常断点,捕获所有未捕获的异常。
尝试点击控制台上方的“播放”按钮,它应该会继续执行(或者至少帮助你了解崩溃是什么)。
发布于 2015-01-03 22:20:13
CGRect screenRect = [[UIScreen mainScreen] bounds];
CGFloat screenWidth = screenRect.size.width;
NSLog(@"Screen width = %f pixel", (float) screenWidth);
CGFloat imageWidth = [[self.widthArray objectAtIndex:indexPath.row] floatValue];
NSLog(@"Image width = %f pixel", (float) imageWidth]);
CGFloat ratio = screenWidth / imageWidth;
NSLog(@"ratio is %f", (float) ratio]);https://stackoverflow.com/questions/27755437
复制相似问题