NFC iOS 13读写问题

时间:2019-06-28 11:49:20

标签: nfc beta xcode11 ios13

我阅读了有关CoreNFC的所有文档,看过有关WWDC 2019读写标签的所有视频,但我没有发现有关我的问题的任何信息。 我需要在办公室写一些开门/开窗的数据标签。我用读取的NFC标签迅速创建了一个简单的项目,但是当我将手机固定在USB阅读器上时,日志中就会遇到下一个麻烦:

2019-06-28 13:45:10.994351+0300 officeProj[872:62700] [xpc.exceptions] <NSXPCConnection: 0x283cec120> connection to service on pid 90 named com.apple.nfcd.service.corenfc: Exception caught during decoding of received selector didDetectExternalReaderWithNotification:, dropping incoming message.
Exception: Exception while decoding argument 0 (#2 of invocation):
Exception: decodeObjectForKey: class "NFFieldNotification" not loaded or does not exist
(
    0   CoreFoundation                      0x00000001a324aa04 2D4D4E9A-884C-31FE-90BE-B324E7B02A3F + 1223172
    1   libobjc.A.dylib                     0x00000001a37574fc objc_exception_throw + 56
    2   Foundation                          0x00000001a2f806dc 6511D0A1-2D67-36FA-BA0E-8FB08A6380FE + 2324188
    3   Foundation                          0x00000001a2d5d6f4 6511D0A1-2D67-36FA-BA0E-8FB08A6380FE + 83700
    4   Foundation                          0x00000001a2fa2410 6511D0A1-2D67-36FA-BA0E-8FB08A6380FE + 2462736
    5   Foundation                          0x00000001a2db22b8 6511D0A1-2D67-36FA-BA0E-8FB08A6380FE + 430776
    6   Foundation                          0x00000001a2db2624 6511D0A1-2D67-36FA-BA0E-8FB08A6380FE + 431652
    7   Foundation                          0x00000001a2d9cc20 6511D0A1-2D67-36FA-BA0E-8FB08A6380FE + 343072
    8   Foundation                          0x00000001a2f7e580 6511D0A1-2D67-36FA-BA0E-8FB08A6380FE + 2315648
    9   libxpc.dylib                        0x00000001a378e63c AC3BE951-8497-3F21-8844-8319F2577646 + 50748
    10  libxpc.dylib                        0x00000001a378e9b4 AC3BE951-8497-3F21-8844-8319F2577646 + 51636
    11  libdispatch.dylib                   0x00000001011d6d10 _dispatch_client_callout4 + 16
    12  libdispatch.dylib                   0x00000001011f0b1c _dispatch_mach_msg_invoke + 420
    13  libdispatch.dylib                   0x00000001011dda10 _dispatch_lane_serial_drain + 304
    14  libdispatch.dylib                   0x00000001011f196c _dispatch_mach_invoke + 520
    15  libdispatch.dylib                   0x00000001011dda10 _dispatch_lane_serial_drain + 304
    16  libdispatch.dylib                   0x00000001011de7a0 _dispatch_lane_invoke + 508
    17  libdispatch.dylib                   0x00000001011e9b74 _dispatch_workloop_worker_thread + 1364
    18  libsystem_pthread.dylib             0x00000001a3a97f5c _pthread_wqthread + 304
    19  libsystem_pthread.dylib             0x00000001a3a9aaa0 start_wqthread + 8
)
(
    0   CoreFoundation                      0x00000001a324aa04 2D4D4E9A-884C-31FE-90BE-B324E7B02A3F + 1223172
    1   libobjc.A.dylib                     0x00000001a37574fc objc_exception_throw + 56
    2   Foundation                          0x00000001a2fa2658 6511D0A1-2D67-36FA-BA0E-8FB08A6380FE + 2463320
    3   Foundation                          0x00000001a2db22b8 6511D0A1-2D67-36FA-BA0E-8FB08A6380FE + 430776
    4   Foundation                          0x00000001a2db2624 6511D0A1-2D67-36FA-BA0E-8FB08A6380FE + 431652
    5   Foundation                          0x00000001a2d9cc20 6511D0A1-2D67-36FA-BA0E-8FB08A6380FE + 343072
    6   Foundation                          0x00000001a2f7e580 6511D0A1-2D67-36FA-BA0E-8FB08A6380FE + 2315648
    7   libxpc.dylib                        0x00000001a378e63c AC3BE951-8497-3F21-8844-8319F2577646 + 50748
    8   libxpc.dylib                        0x00000001a378e9b4 AC3BE951-8497-3F21-8844-8319F2577646 + 51636
    9   libdispatch.dylib                   0x00000001011d6d10 _dispatch_client_callout4 + 16
    10  libdispatch.dylib                   0x00000001011f0b1c _dispatch_mach_msg_invoke + 420
    11  libdispatch.dylib                   0x00000001011dda10 _dispatch_lane_serial_drain + 304
    12  libdispatch.dylib                   0x00000001011f196c _dispatch_mach_invoke + 520
    13  libdispatch.dylib                   0x00000001011dda10 _dispatch_lane_serial_drain + 304
    14  libdispatch.dylib                   0x00000001011de7a0 _dispatch_lane_invoke + 508
    15  libdispatch.dylib                   0x00000001011e9b74 _dispatch_workloop_worker_thread + 1364
    16  libsystem_pthread.dylib             0x00000001a3a97f5c _pthread_wqthread + 304
    17  libsystem_pthread.dylib             0x00000001a3a9aaa0 start_wqthread + 8
)

我试图找到一些有关decodeObjectForKey的信息:类“ NFFieldNotification”,但在Google页面上确实没有任何信息。也许有人可以帮我吗?还是iOS 13 beta 2或xCode 11 beta 2如此原始?假设这个问题对将来有帮助...

2 个答案:

答案 0 :(得分:0)

您有解决方案吗?我正面临着同样的问题。 你知道在哪里添加“ didDetectExternalReaderWithNotification”这个参数吗?

答案 1 :(得分:-1)

我遇到了同样的问题并通过添加解决了

CoreNFC.framework

xyz.xcodeproj - >构建阶段 - >链接二进制使用库

(xyz.xcodeproj是我的项目根文件)