I'm trying to get some rows from DynamoDB in a Swift application. At the very last line in my code below I get a NSInvalidArgumentException. I think it must be because my request is not formatted correctly, but I don't know what is wrong. In the docs (batch operation sample) for the java sdk they use TableKeysAndAttributes, which doesn't seem to exist in the iOS SDK.
Here is my code:
var venueIdAttribute = AWSDynamoDBAttributeValue()
venueIdAttribute.N = "2164156"
var venueIdCondition = AWSDynamoDBCondition()
venueIdCondition.comparisonOperator = .EQ // Hash Key must always be Equals
venueIdCondition.attributeValueList = [venueIdAttribute]
var startDateAttribute = AWSDynamoDBAttributeValue()
var startString = String(format:"%1.0f", lastSyncDate.timeIntervalSince1970 * 1000)
startDateAttribute.N = String(format:"%1.0f", lastSyncDate.timeIntervalSince1970 * 1000)
var dateCondition = AWSDynamoDBCondition()
dateCondition.comparisonOperator = .GT
dateCondition.attributeValueList = [startDateAttribute];
var keysArray : NSArray = [["venueId" : venueIdCondition, "dateInterval" : dateCondition]]
var tableDict : NSDictionary = ["Keys":keysArray]
var requestMap : NSDictionary = ["myTable":tableDict]
var request : AWSDynamoDBBatchGetItemInput = AWSDynamoDBBatchGetItemInput()
request.requestItems = requestMap
request.returnConsumedCapacity = AWSDynamoDBReturnConsumedCapacity.Total
var response : BFTask = dynamoDB.batchGetItem(request) // This is synchronous
Here is the error:
2014-12-18 13:23:17.002 TouchDashboard[8066:503166] +[NSDictionaryI JSONKeyPathsByPropertyKey]: unrecognized selector sent to class 0x10a9930e8
2014-12-18 13:23:17.010 TouchDashboard[8066:503166] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[__NSDictionaryI JSONKeyPathsByPropertyKey]: unrecognized selector sent to class 0x10a9930e8'
*** First throw call stack:
(
0 CoreFoundation 0x000000010a6ebf35 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010c5b1bb7 objc_exception_throw + 45
2 CoreFoundation 0x000000010a6f2f4d +[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x000000010a64b27c ___forwarding_ + 988
4 CoreFoundation 0x000000010a64ae18 _CF_forwarding_prep_0 + 120
5 TouchDashboard 0x0000000109b1176a -[MTLJSONAdapter initWithModel:] + 490
6 TouchDashboard 0x0000000109b0fc47 +[MTLJSONAdapter JSONDictionaryFromModel:] + 87
7 TouchDashboard 0x00000001099a47c5 +[AZModelUtility JSONDictionaryFromMapMTLDictionary:] + 517
8 TouchDashboard 0x0000000109a91c5b 59+[AWSDynamoDBBatchGetItemInput requestItemsJSONTransformer]_block_invoke_2 + 75
9 TouchDashboard 0x0000000109b21718 -[MTLReversibleValueTransformer reverseTransformedValue:] + 88
10 TouchDashboard 0x0000000109b11b90 __32-[MTLJSONAdapter JSONDictionary]_block_invoke + 480
11 CoreFoundation 0x000000010a62d766 __65-[__NSDictionaryM enumerateKeysAndObjectsWithOptions:usingBlock:]_block_invoke + 102
12 CoreFoundation 0x000000010a62d66c -[__NSDictionaryM enumerateKeysAndObjectsWithOptions:usingBlock:] + 204
13 TouchDashboard 0x0000000109b1192c -[MTLJSONAdapter JSONDictionary] + 300
14 TouchDashboard 0x0000000109b0fc5b +[MTLJSONAdapter JSONDictionaryFromModel:] + 107
15 TouchDashboard 0x00000001099a6829 -[AWSDynamoDB invokeRequest:HTTPMethod:URLString:targetPrefix:operationName:outputClass:] + 313
16 TouchDashboard 0x00000001099a6bd9 -[AWSDynamoDB batchGetItem:] + 153
17 TouchDashboard 0x000000010991a0d7 _TFC14TouchDashboard14ViewController9batchSyncfS0_FT_T_ + 10663
18 TouchDashboard 0x0000000109917349 _TFC14TouchDashboard14ViewController11viewDidLoadfS0_FT_T_ + 1161
19 TouchDashboard 0x0000000109917462 _TToFC14TouchDashboard14ViewController11viewDidLoadfS0_FT_T_ + 34
20 UIKit 0x000000010b41ea90 -[UIViewController loadViewIfRequired] + 738
21 UIKit 0x000000010b41ec8e -[UIViewController view] + 27
22 UIKit 0x000000010b33dca9 -[UIWindow addRootViewControllerViewIfPossible] + 58
23 UIKit 0x000000010b33e041 -[UIWindow _setHidden:forced:] + 247
24 UIKit 0x000000010b34a72c -[UIWindow makeKeyAndVisible] + 42
25 UIKit 0x000000010b2f5061 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 2628
26 UIKit 0x000000010b2f7d2c -[UIApplication _runWithMainScene:transitionContext:completion:] + 1350
27 UIKit 0x000000010b2f6bf2 -[UIApplication workspaceDidEndTransaction:] + 179
28 FrontBoardServices 0x000000010ebe92a3 __31-[FBSSerialQueue performAsync:]_block_invoke + 16
29 CoreFoundation 0x000000010a62153c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK + 12
30 CoreFoundation 0x000000010a617285 __CFRunLoopDoBlocks + 341
31 CoreFoundation 0x000000010a616a43 __CFRunLoopRun + 851
32 CoreFoundation 0x000000010a616486 CFRunLoopRunSpecific + 470
33 UIKit 0x000000010b2f6669 -[UIApplication _run] + 413
34 UIKit 0x000000010b2f9420 UIApplicationMain + 1282
35 TouchDashboard 0x000000010992ba2e top_level_code + 78
36 TouchDashboard 0x000000010992ba6a main + 42
37 libdyld.dylib 0x000000010cd8b145 start + 1
38 ??? 0x0000000000000001 0x0 + 1
AWSDynamoDBBatchGetItemInput's requestItems property needs to be a dictionary of the following key/value pair:
NSString (a table name) : AWSDynamoDBKeysAndAttributes (KeysAndAttributes)
Currently, you are passing an instance of NSDictionary as a value. Once you update your code snippet to use AWSDynamoDBKeysAndAttributes, it should work.
Related
I'm trying to figure out why I cannot check for nil on the following function call:
var allExercises : Results<Exercises>?
var exerciseIndex : Int = 0
#objc func goToNextExercise(){
if allExercises?[exerciseIndex] != nil {
print("Does not equal nil")
exerciseIndex += 1
} else {
print("Does equal nil")
}
}
When allExercises?[exerciseIndex] does equal nil, the application crashes and I get an "indexPath out of Range" error:
*** Terminating app due to uncaught exception 'RLMException', reason: 'Index 3 is out of bounds (must be less than 3).'
*** First throw call stack:
(
0 CoreFoundation 0x0000000104a7127e __exceptionPreprocess + 350
1 libobjc.A.dylib 0x00000001048deb20 objc_exception_throw + 48
2 SectionRowsTutorial 0x00000001025d7aae _Z20RLMThrowResultsErrorP8NSString + 670
3 SectionRowsTutorial 0x00000001025d8cc6 _ZL25translateRLMResultsErrorsIZ28-[RLMResults objectAtIndex:]E3$_6EDaOT_P8NSString + 118
4 SectionRowsTutorial 0x00000001025d8bf4 -[RLMResults objectAtIndex:] + 100
5 SectionRowsTutorial 0x000000010278c9dc $s10RealmSwift7ResultsVyxSicig + 236
6 SectionRowsTutorial 0x00000001022dc576 $s19SectionRowsTutorial19ThirdViewControllerC16goToNextExerciseyyF + 246
7 SectionRowsTutorial 0x00000001022dc87b $s19SectionRowsTutorial19ThirdViewControllerC16goToNextExerciseyyFTo + 43
8 UIKitCore 0x0000000108571fff -[UIApplication sendAction:to:from:forEvent:] + 83
9 UIKitCore 0x0000000107f4a00e -[UIControl sendAction:to:forEvent:] + 223
10 UIKitCore 0x0000000107f4a358 -[UIControl _sendActionsForEvents:withEvent:] + 398
11 UIKitCore 0x0000000107f492b7 -[UIControl touchesEnded:withEvent:] + 481
12 UIKitCore 0x00000001085acbbf -[UIWindow _sendTouchesForEvent:] + 2604
13 UIKitCore 0x00000001085ae4c6 -[UIWindow sendEvent:] + 4596
14 UIKitCore 0x000000010858953b -[UIApplication sendEvent:] + 356
15 UIKitCore 0x000000010860a71a __dispatchPreprocessedEventFromEventQueue + 6847
16 UIKitCore 0x000000010860d1e0 __handleEventQueueInternal + 5980
17 CoreFoundation 0x00000001049d4471 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
18 CoreFoundation 0x00000001049d439c __CFRunLoopDoSource0 + 76
19 CoreFoundation 0x00000001049d3b74 __CFRunLoopDoSources0 + 180
20 CoreFoundation 0x00000001049ce87f __CFRunLoopRun + 1263
21 CoreFoundation 0x00000001049ce066 CFRunLoopRunSpecific + 438
22 GraphicsServices 0x000000010e756bb0 GSEventRunModal + 65
23 UIKitCore 0x0000000108570d4d UIApplicationMain + 1621
24 SectionRowsTutorial 0x00000001022e759b main + 75
25 libdyld.dylib 0x0000000105ba4c25 start + 1
26 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
You are checking the value of allExercises, if you pass a greater index than the array size, it's crashing. for check, you should first check if exerciseIndex is less than allExercises count - 1 and then check data
if exerciseIndex <= allExercises.count - 1
I am trying to save the JSON response in the realm using Alamofire and ObjectMapper. And I am getting this error:
* Terminating app due to uncaught exception 'RLMException', reason: 'Index 0 is out of bounds (must be less than 0).'
* First throw call stack:
(
0 CoreFoundation 0x00000001113e18db exceptionPreprocess + 331
1 libobjc.A.dylib 0x0000000110984ac5 objc_exception_throw + 48
2 Realm 0x000000010e30efee _Z20RLMThrowResultsErrorP8NSString + 670
3 Realm 0x000000010e310206 _ZL25translateRLMResultsErrorsIZ28-[RLMResults objectAtIndex:]E3$_6EDaOT_P8NSString + 118
4 Realm 0x000000010e310136 -[RLMResults objectAtIndex:] + 102
5 RealmSwift 0x000000010fa37436 $s10RealmSwift7ResultsCyxSicig + 262
6 App Name 0x000000010c0e9155 $s24Mahalaxmi_Life_Insurance12CalculatorVCC14collectionView_22numberOfItemsInSectionSiSo012UICollectionG0C_SitF + 197
7 App Name 0x000000010c0e934c $s24Mahalaxmi_Life_Insurance12CalculatorVCC14collectionView_22numberOfItemsInSectionSiSo012UICollectionG0C_SitFTo + 76
8 UIKitCore 0x00000001155dd2c3 -[UICollectionViewData _updateItemCounts] + 409
9 UIKitCore 0x00000001155dfb4f -[UICollectionViewData numberOfSections] + 22
10 UIKitCore 0x00000001155eafbe -[UICollectionViewFlowLayout _getSizingInfosWithExistingSizingDictionary:] + 511
11 UIKitCore 0x00000001155ed228 -[UICollectionViewFlowLayout _fetchItemsInfoForRect:] + 231
12 UIKitCore 0x00000001155e5dc1 -[UICollectionViewFlowLayout prepareLayout] + 246
13 UIKitCore 0x00000001155dd5a8 -[UICollectionViewData _prepareToLoadData] + 212
14 UIKitCore 0x00000001155ddfb4 -[UICollectionViewData validateLayoutInRect:] + 53
15 UIKitCore 0x00000001155acec6 -[UICollectionView layoutSubviews] + 261
16 UIKitCore 0x000000011620ae69 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1417
17 QuartzCore 0x000000010de75d22 -[CALayer layoutSublayers] + 173
18 QuartzCore 0x000000010de7a9fc _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 396
19 QuartzCore 0x000000010de86d58 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 72
20 QuartzCore 0x000000010ddf624a _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 328
21 QuartzCore 0x000000010de2d606 _ZN2CA11Transaction6commitEv + 610
22 UIKitCore 0x0000000115d5399c _afterCACommitHandler + 245
23 CoreFoundation 0x00000001113482c7 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION + 23
24 CoreFoundation 0x000000011134278e __CFRunLoopDoObservers + 430
25 CoreFoundation 0x0000000111342e01 __CFRunLoopRun + 1505
26 CoreFoundation 0x00000001113424d2 CFRunLoopRunSpecific + 626
27 GraphicsServices 0x000000011971b2fe GSEventRunModal + 65
28 UIKitCore 0x0000000115d2bfc2 UIApplicationMain + 140
29 App Name 0x000000010c0a976b main + 75
30 libdyld.dylib 0x000000011238e541 start + 1
31 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
JSON Response is like this
["Title": [ "S", "Y", "H", "Q", "M" ]]
My Model is like this
class TermList : Object, Mappable {
#objc dynamic var mainTerm : String?
var payingTerm = [String]?
required convenience init?(map: Map) {
self.init()
}
func mapping(map: Map) {
mainTerm <- map["MainTerm"]
payingTerm <- map["PayingTerm"]
}
}
I cannot implement IN in NSPredicate. I am getting this error. I have checked everything but hasnt been able to resolve this. Has anyone found similar issue?
Here's my model
And Here's the code Im doing
let messageLocalFetchRequest = NSFetchRequest<NSFetchRequestResult>.init(entityName: "Transaction")
messageLocalFetchRequest.predicate = NSPredicate.init(format: "category IN %#", ["Food","Rent"])
let array = try? self.context?.fetch(messageLocalFetchRequest)
Here's complete Log
2017-05-15 19:31:33.985 BudgetApp[26354:184185] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'unimplemented SQL generation for predicate : (category IN {"Food", "Rent"})'
*** First throw call stack:
(
0 CoreFoundation 0x01719ded __exceptionPreprocess + 189
1 libobjc.A.dylib 0x00dfad6f objc_exception_throw + 49
2 CoreData 0x0138266e -[NSSQLGenerator newSQLStatementForRequest:ignoreInheritance:countOnly:nestingLevel:nestIsWhereScoped:requestContext:] + 1710
3 CoreData 0x013826b1 -[NSSQLGenerator newSQLStatementForFetchRequest:ignoreInheritance:countOnly:nestingLevel:nestIsWhereScoped:requestContext:] + 49
4 CoreData 0x0138c1ce -[NSSQLiteAdapter _statementForFetchRequestContext:ignoreInheritance:countOnly:nestingLevel:] + 206
5 CoreData 0x0126256e -[NSSQLiteAdapter newSelectStatementWithFetchRequestContext:ignoreInheritance:] + 158
6 CoreData 0x013b91cb -[NSSQLFetchRequestContext _createStatement] + 75
7 CoreData 0x013b913d -[NSSQLFetchRequestContext fetchStatement] + 45
8 CoreData 0x013ba540 -[NSSQLFetchRequestContext executeRequestUsingConnection:] + 64
9 CoreData 0x013e76d3 __52-[NSSQLDefaultConnectionManager handleStoreRequest:]_block_invoke + 275
10 libdispatch.dylib 0x05473cc9 _dispatch_client_callout + 14
11 libdispatch.dylib 0x0544fac4 _dispatch_barrier_sync_f_invoke + 180
12 libdispatch.dylib 0x0544f82b dispatch_barrier_sync_f + 157
13 libdispatch.dylib 0x0544fbb8 dispatch_sync + 41
14 CoreData 0x013e7571 -[NSSQLDefaultConnectionManager handleStoreRequest:] + 241
15 CoreData 0x013eec7a -[NSSQLCoreDispatchManager routeStoreRequest:] + 282
16 CoreData 0x0136e645 -[NSSQLCore dispatchRequest:withRetries:] + 213
17 CoreData 0x0136b421 -[NSSQLCore processFetchRequest:inContext:] + 113
18 CoreData 0x01261b31 -[NSSQLCore executeRequest:withContext:error:] + 465
19 CoreData 0x01354481 __65-[NSPersistentStoreCoordinator executeRequest:withContext:error:]_block_invoke + 2769
20 CoreData 0x0134c3e5 -[NSPersistentStoreCoordinator _routeHeavyweightBlock:] + 341
21 CoreData 0x01261703 -[NSPersistentStoreCoordinator executeRequest:withContext:error:] + 579
22 CoreData 0x0125fb93 -[NSManagedObjectContext executeFetchRequest:error:] + 675
23 BudgetApp 0x000d0cfb _TFC9BudgetApp30TransactionTableViewController11viewDidLoadfT_T_ + 2059
24 BudgetApp 0x000d1052 _TToFC9BudgetApp30TransactionTableViewController11viewDidLoadfT_T_ + 34
25 UIKit 0x025ef61c -[UIViewController _sendViewDidLoadWithAppearanceProxyObjectTaggingEnabled] + 38
26 UIKit 0x025f3fa5 -[UIViewController loadViewIfRequired] + 1434
27 UIKit 0x026386b4 -[UINavigationController _layoutViewController:] + 52
28 UIKit 0x02638f57 -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 427
29 UIKit 0x026390e6 -[UINavigationController _startTransition:fromViewController:toViewController:] + 123
30 UIKit 0x0263a26d -[UINavigationController _startDeferredTransitionIfNeeded:] + 979
31 UIKit 0x0263b698 -[UINavigationController __viewWillLayoutSubviews] + 70
32 UIKit 0x02852fd9 -[UILayoutContainerView layoutSubviews] + 235
33 UIKit 0x024fdb23 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1418
34 libobjc.A.dylib 0x00e101d9 -[NSObject performSelector:withObject:] + 59
35 QuartzCore 0x022b50ea -[CALayer layoutSublayers] + 141
36 QuartzCore 0x022a8486 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 398
37 QuartzCore 0x022a82e3 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 21
38 QuartzCore 0x02234a92 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 334
39 QuartzCore 0x02261f8f _ZN2CA11Transaction6commitEv + 483
40 QuartzCore 0x02263b60 _ZN2CA11Transaction17flush_transactionEv + 38
41 UIKit 0x024233a7 _UIApplicationFlushRunLoopCATransactionIfTooLate + 182
42 UIKit 0x02cbe95e __handleEventQueue + 2054
43 UIKit 0x02cbfba3 __handleHIDEventFetcherDrain + 66
44 CoreFoundation 0x016bea5f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
45 CoreFoundation 0x016a41c4 __CFRunLoopDoSources0 + 500
46 CoreFoundation 0x016a369c __CFRunLoopRun + 1084
47 CoreFoundation 0x016a2fd4 CFRunLoopRunSpecific + 372
48 CoreFoundation 0x016a2e4b CFRunLoopRunInMode + 123
49 GraphicsServices 0x070f7a7a GSEventRunModal + 71
50 GraphicsServices 0x070f795f GSEventRun + 80
51 UIKit 0x0242acb9 UIApplicationMain + 148
52 BudgetApp 0x000bc59b main + 75
53 libdyld.dylib 0x054ae779 start + 1
54 ??? 0x00000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
String is object, so you can't just use IN:
Objective-C
[NSPredicate predicateWithFormat:#"ANY %# LIKE[cd] category", #[#"Food",#"Rent"]]
Swift 3.1
NSPredicate(format: "ANY %# LIKE[cd] category", ["Food", "Rent"])
let content: FBSDKShareLinkContent = FBSDKShareLinkContent()
content.contentURL = NSURL(string: "https://www.google.com")
content.contentTitle = "ContentTitle"
content.contentDescription = "ContentDescription"
let shareDialog = FBSDKShareDialog();
shareDialog.mode = .Browser
shareDialog.shareContent = content
shareDialog.show()
This is the code I used to share.
While sharing i getting the crash like below
'NSInvalidArgumentException', reason: '-[FBSDKApplicationDelegate openBridgeAPIRequest:useSafariViewController:fromViewController:completionBlock:]: unrecognized selector sent to instance 0x7fa69031c9d0'
*** First throw call stack:
(
0 CoreFoundation 0x000000010c2f1e65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010bcd8deb objc_exception_throw + 48
2 CoreFoundation 0x000000010c2fa48d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x000000010c24790a ___forwarding___ + 970
4 CoreFoundation 0x000000010c2474b8 _CF_forwarding_prep_0 + 120
5 Store 0x000000010a42a858 -[FBSDKShareDialog _showBrowser:] + 417
6 Store 0x000000010a4297c8 -[FBSDKShareDialog show] + 327
7 Store 0x000000010a351d47 _TFC5Store25StorePlayerViewController17didTapShareButtonfS0_FSiT_ + 1847
8 Store 0x000000010a351e6a _TToFC5Store25StorePlayerViewController17didTapShareButtonfS0_FSiT_ + 42
9 Store 0x000000010a35acb0 _TTDFC5Store25StorePlayerViewController17didTapShareButtonfS0_FSiT_ + 48
10 Store 0x000000010a35231d _TTWC5Store25StorePlayerViewControllerS_31DopeMeterViewControllerDelegateS_FS1_17didTapShareButtonuRq_S1__fq_FSiT_ + 45
11 Store 0x000000010a3e24c9 _TFC5Store23DopeMeterViewController12OnShareClickfS0_FCSo8UIButtonT_ + 201
12 Store 0x000000010a3e254a _TToFC5Store23DopeMeterViewController12OnShareClickfS0_FCSo8UIButtonT_ + 58
13 UIKit 0x000000010c6a1194 -[UIApplication sendAction:to:from:forEvent:] + 92
14 UIKit 0x000000010c8106fc -[UIControl sendAction:to:forEvent:] + 67
15 UIKit 0x000000010c8109c8 -[UIControl _sendActionsForEvents:withEvent:] + 311
16 UIKit 0x000000010c80faf8 -[UIControl touchesEnded:withEvent:] + 601
17 UIKit 0x000000010c71049b -[UIWindow _sendTouchesForEvent:] + 835
18 UIKit 0x000000010c7111d0 -[UIWindow sendEvent:] + 865
19 UIKit 0x000000010c6bfb66 -[UIApplication sendEvent:] + 263
20 UIKit 0x000000010c699d97 _UIApplicationHandleEventQueue + 6844
21 CoreFoundation 0x000000010c21da31 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
22 CoreFoundation 0x000000010c21395c __CFRunLoopDoSources0 + 556
23 CoreFoundation 0x000000010c212e13 __CFRunLoopRun + 867
24 CoreFoundation 0x000000010c212828 CFRunLoopRunSpecific + 488
25 GraphicsServices 0x000000010f640ad2 GSEventRunModal + 161
26 UIKit 0x000000010c69f610 UIApplicationMain + 171
27 doopaadoo 0x00000001090a019d main + 109
28 libdyld.dylib 0x0000000112cb192d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
I search lot bt cant find any solution.
can someone give me a hint why i always geht an
"DSJSONRPC doesNotRecognizeSelector" when calling jsonrpc interface from XBMC?
Result in console:
*** JSON-RPC REQUEST:
{
id = 654509193;
jsonrpc = "2.0";
method = "Player.GetActivePlayers";
params = {
};
}
Code:
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)
Using DSJSONRPC from Demiurgic JSON RPC
Can't find the error - on XBMC a movie is playing at this time...
Thanks in advance,
cheese
here the error stack:
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
ok, found the problem - perhaps I have an old version of the JSON class...
There was an uninitialised error variable...
changing it to nil then everything works like a charm.
thanks anyway :)