为什么在XBMC上调用JSONRPC时未知选择器



有人可以给我一个提示,为什么我总是嘶吼"DSJSONRPC doesNotRecognizeSelector" 当从 XBMC 调用 jsonrpc 接口时?

控制台中的结果:

*** JSON-RPC REQUEST:
{
    id = 654509193;
    jsonrpc = "2.0";
    method = "Player.GetActivePlayers";
    params =     {
    };
}

法典:

DSJSONRPC *jsonRPC = [[DSJSONRPC alloc] initWithServiceEndpoint:[NSURL URLWithString:@"http://192.168.1.101:8080/jsonrpc"]];
    [jsonRPC callMethod:@"Player.GetActivePlayers" withParameters:@{ }
              onCompletion:^(NSString *methodName, NSInteger callId, id methodResult, DSJSONRPCError *methodError, NSError* internalError)

使用 Demiurgic JSON RPC 的 DSJSONRPC

找不到错误 - 此时在 XBMC 上正在播放电影...

提前感谢,奶酪

这里是错误堆栈:

2013-12-22 22:02:52.846 XBMCapp[3529:70b] *** JSON-RPC REQUEST:
{
    id = "-1698136466";
    jsonrpc = "2.0";
    method = "Player.GetActivePlayers";
    params =     {
    };
}
2013-12-22 22:02:52.847 XBMCapp[3529:70b] Error:<DSJSONRPC: 0x95c11b0>
2013-12-22 22:02:52.847 XBMCapp[3529:70b] -[DSJSONRPC localizedDescription]: unrecognized selector sent to instance 0x95c11b0
2013-12-22 22:02:52.873 XBMCapp[3529:70b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[DSJSONRPC localizedDescription]: unrecognized selector sent to instance 0x95c11b0'
*** First throw call stack:
(
    0   CoreFoundation                      0x01ef25e4 __exceptionPreprocess + 180
    1   libobjc.A.dylib                     0x018058b6 objc_exception_throw + 44
    2   CoreFoundation                      0x01f8f903 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
    3   CoreFoundation                      0x01ee290b ___forwarding___ + 1019
    4   CoreFoundation                      0x01ee24ee _CF_forwarding_prep_0 + 14
    5   XBMCapp                          0x000109ab -[DSJSONRPC callMethod:withParameters:onCompletion:] + 477
    6   XBMCapp                          0x000054df -[RootViewController nowplayingAction:] + 298
    7   libobjc.A.dylib                     0x01817874 -[NSObject performSelector:withObject:withObject:] + 77
    8   UIKit                               0x004780c2 -[UIApplication sendAction:to:from:forEvent:] + 108
    9   UIKit                               0x0074cc9b -[UIBarButtonItem(UIInternal) _sendAction:withEvent:] + 139
    10  libobjc.A.dylib                     0x01817874 -[NSObject performSelector:withObject:withObject:] + 77
    11  UIKit                               0x004780c2 -[UIApplication sendAction:to:from:forEvent:] + 108
    12  UIKit                               0x0047804e -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 61
    13  UIKit                               0x005700c1 -[UIControl sendAction:to:forEvent:] + 66
    14  UIKit                               0x00570484 -[UIControl _sendActionsForEvents:withEvent:] + 577
    15  UIKit                               0x0056f733 -[UIControl touchesEnded:withEvent:] + 641
    16  UIKit                               0x004b551d -[UIWindow _sendTouchesForEvent:] + 852
    17  UIKit                               0x004b6184 -[UIWindow sendEvent:] + 1232
    18  UIKit                               0x00489e86 -[UIApplication sendEvent:] + 242
    19  UIKit                               0x0047418f _UIApplicationHandleEventQueue + 11421
    20  CoreFoundation                      0x01e7b83f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
    21  CoreFoundation                      0x01e7b1cb __CFRunLoopDoSources0 + 235
    22  CoreFoundation                      0x01e9829e __CFRunLoopRun + 910
    23  CoreFoundation                      0x01e97ac3 CFRunLoopRunSpecific + 467
    24  CoreFoundation                      0x01e978db CFRunLoopRunInMode + 123
    25  GraphicsServices                    0x02d889e2 GSEventRunModal + 192
    26  GraphicsServices                    0x02d88809 GSEventRun + 104
    27  UIKit                               0x00476d3b UIApplicationMain + 1225
    28  XBMCapp                          0x0000234b main + 93
    29  libdyld.dylib                       0x02a2a70d start + 1
    30  ???                                 0x00000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

好的,发现了问题 - 也许我有一个旧版本的 JSON 类......有一个未初始化的错误变量...将其更改为 nil 然后一切都像魅力一样工作。

无论如何,谢谢:)

最新更新