除了允许调试应用程序的明显功能(大多数情况下使用调试配置),为什么要启用此选项,例如,即使在发布配置中也是如此?
这个功能有什么用?
如标题中所述,当我尝试执行以下divsion时,我会得到两个不同的结果,具体取决于设备的体系结构:
unsigned int a = 42033;
unsigned int b = 360;
unsigned int c = 466
double result = a / (double)(b * c);
// on arm64 -> result = 0.25055436337625181
// on armv7 -> result = 0.24986030696800732
Run Code Online (Sandbox Code Playgroud)
为什么结果不匹配?
根据针对Cocoa Touch的 Apple 64位过渡指南,这些数据类型在32位和64位运行时具有相同的大小.
编辑
完整的代码:
#import "UIImage+MyCategory.h"
#define CLIP_THRESHOLD 0.74 // if this much of the image is the clip color, leave it alone
typedef struct {
unsigned int leftNonColorIndex;
unsigned int rightNonColorIndex;
unsigned int nonColorCount;
} scanLineResult; …Run Code Online (Sandbox Code Playgroud)