以下代码不适用于64位架构和IOS-8.0
版本
CGRect r1 = [[[signature.rawPoints objectAtIndex:i]objectAtIndex:j] CGRectValue];
错误:
2015-06-04 19:18:45.933 MySampleCloset UAT [40174:865394] - [T1SignaturePoint CGRectValue]:无法识别的选择器发送到实例0x7f90d86b75a0 2015-06-04 19:18:45.977 MySampleCloset UAT [40174:865394] *因未捕获的异常而终止应用 'NSInvalidArgumentException',原因:' - [T1SignaturePoint CGRectValue]:无法识别的选择器发送到实例0x7f90d86b75a0' * 首先抛出调用堆栈:
请为此问题提出解决方案?
答案 0 :(得分:0)
作为将应用程序移植到64位的一部分,我们将IOS版本更改为8.2然后我们就遇到了这个问题。 Pl查看32位和64位的输出,用于" signature.rawPoints" 32位IOS小于8.0版本输出: ( " NSRect:{{130,142.5},{2.3333333,100}}", " NSRect:{{136,139.5},{2.4990008,101}}", " NSRect:{{152.25,131},{2.0691545,102}}", " NSRect:{{169.75,121},{1.7328094,103}}", " NSRect:{{185.25,111},{1.5653242,104}}", " NSRect:{{196.125,104},{1.6099705,105}}", " NSRect:{{200.75,101.375},{1.9532523,106}}" ),
64位IOS8.2版本输出: ( " \ nlocation:87.000000,112.000000 \ nvelocity:0.000000,0.000000 \ nacceleration:0.000000,0.000000 \ ntimestamp:19476.794956 \ npressure:1.000000 \ ndiameter:4.666667 \ nid:100", " \ nlocation:88.000000,116.000000 \ nvelocity:22.341108,89.364433 \ nacceleration:499.125115,1996.500461 \ ntimestamp:19476.839717 \ npressure:1.000000 \ ndiameter:5.006714 \ nid:101", " \ nlocation:92.000000,125.000000 \ nvelocity:228.450167,514.012876 \ nacceleration:11771.412252,24252.751985 \ ntimestamp:19476.857226 \ npressure:1.000000 \ ndiameter:4.700317 \ nid:102", " \ nlocation:97.000000,134.000000 \ nvelocity:298.178096,536.720573 \ nacceleration:4158.268213,1354.187550 \ ntimestamp:19476.873995 \ npressure:1.000000 \ ndiameter:4.437694 \ nid:103")
实际上我们需要获取以下代码的rect值 CGRect r1 = [[[signature.rawPoints objectAtIndex:i] objectAtIndex:j] CGRectValue];
当我尝试使用低于8.0版本的IOS打印以下代码时 代码:[[signature.rawPoints objectAtIndex:i] objectAtIndex:j] CGRectValue] 输出:{130,142.5}
但是对于IOS版本8.2和64位我们正在获得以下输出 OUTPUT: 位置:87.000000,112.000000 速度:0.000000,0.000000 加速度:0.000000,0.000000 时间戳:19476.794956 当我们执行以下代码时,我们收到以下错误 代码:CGRect r1 = [[[signature.rawPoints objectAtIndex:i] objectAtIndex:j] CGRectValue]; 错误: 2015-06-04 19:18:45.933 MySampleCloset UAT [40174:865394] - [T1SignaturePoint CGRectValue]:无法识别的选择器发送到实例0x7f90d86b75a0 2015-06-04 19:18:45.977 MySampleCloset UAT [40174:865394] ***终止应用程序由于未捕获的异常' NSInvalidArgumentException',原因:' - [T1SignaturePoint CGRectValue]:无法识别的选择器发送到实例0x7f90d86b75a0'