简体   繁体   English

iOS8 Objective-C SignaturePoint CGRectValue

[英]IOS8 Objective-C SignaturePoint CGRectValue

Below is the output for "signature.rawPoints" with 32bit architecture Objective-C code 以下是具有32位体系结构Objective-C代码的“ signature.rawPoints”的输出

(
        "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}}"
    ),

But with 64bit architecture along with IOS8 below is the output 但是输出是64位架构,下面是IOS8

(
        "\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")

The below code is not working with 64-bit architecture on the above rawpoints to find CGRectValues. 以下代码无法在上述原始点上使用64位体系结构来查找CGRectValues。

CGRect r1 = [[[signature.rawPoints objectAtIndex:i]objectAtIndex:j] CGRectValue]; 

Error: 错误:

2015-06-04 19:18:45.933 MySampleCloset UAT[40174:865394] -[T1SignaturePoint CGRectValue]: unrecognized selector sent to instance 0x7f90d86b75a0 2015-06-04 19:18:45.977 MySampleCloset UAT[40174:865394] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[T1SignaturePoint CGRectValue]: unrecognized selector sent to instance 0x7f90d86b75a0' 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'

Please suggest a solution. 请提出解决方案。

Check your code carefully. 仔细检查您的代码。 Unrecognized selector means, that you try to use method to "wrong" object, like treating NSString as an NSArray for example, and sending NSString objectAtIndex message. 无法识别的选择器意味着您尝试使用“错误”对象的方法,例如将NSString视为NSArray ,并发送NSString objectAtIndex消息。

Or maybe, you using some kind of 3rd libraries, and they are not updated for 64 bit architecture. 或者,也许您使用了某种第三库,但它们并未针对64位体系结构进行更新。

If you want better answer then that, edit your code with CMD+K and show us your code.. 如果您想得到更好的答案,请使用CMD+K编辑代码,然后向我们显示您的代码。

TSignaturePoint.h added into the latest third point TSignature library, so we have to use the below code to find the x and y co ordinates for the signature of every letter. TSignaturePoint.h已添加到最新的第三点TSignature库中,因此我们必须使用以下代码来查找每个字母的签名的x和y坐标。

CGPoint p = [[[signature.rawPoints objectAtIndex:i]objectAtIndex:j] location]; CGPoint p = [[[signature.rawPoints objectAtIndex:i] objectAtIndex:j]位置];

Note: [[signature.rawPoints objectAtIndex:i]objectAtIndex:j] is the type of TSignature. 注意:[[signature.rawPoints objectAtIndex:i] objectAtIndex:j]是TSignature的类型。

we can also write the above as below TSignature * sig = [[signature.rawPoints objectAtIndex:i]objectAtIndex:j]; 我们也可以将下面的代码写成下面的代码:TSignature * sig = [[signature.rawPoints objectAtIndex:i] objectAtIndex:j]; CGPoint p = sig.location; CGPoint p =信号位置;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM