![](/img/trans.png)
[英]dataTaskWithRequest VS sendAsynchronousRequest in iOS8/9 using Objective-c
[英]IOS8 Objective-C SignaturePoint CGRectValue
以下是具有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}}"
),
但是輸出是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")
以下代碼無法在上述原始點上使用64位體系結構來查找CGRectValues。
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'
請提出解決方案。
仔細檢查您的代碼。 無法識別的選擇器意味着您嘗試使用“錯誤”對象的方法,例如將NSString
視為NSArray
,並發送NSString
objectAtIndex
消息。
或者,也許您使用了某種第三庫,但它們並未針對64位體系結構進行更新。
如果您想得到更好的答案,請使用CMD+K
編輯代碼,然后向我們顯示您的代碼。
TSignaturePoint.h已添加到最新的第三點TSignature庫中,因此我們必須使用以下代碼來查找每個字母的簽名的x和y坐標。
CGPoint p = [[[signature.rawPoints objectAtIndex:i] objectAtIndex:j]位置];
注意:[[signature.rawPoints objectAtIndex:i] objectAtIndex:j]是TSignature的類型。
我們也可以將下面的代碼寫成下面的代碼:TSignature * sig = [[signature.rawPoints objectAtIndex:i] objectAtIndex:j]; CGPoint p =信號位置;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.