Fetching data from `plist` - ios

I am using for in loop to fetch data from plist. But it is showing following exception:
2015-07-16 11:16:43.597 plistNeha[640:60b] -[__NSCFDictionary objectAtIndexedSubscript:]: unrecognized selector sent to instance 0x8d671b0
2015-07-16 11:16:43.721 plistNeha[640:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFDictionary objectAtIndexedSubscript:]: unrecognized selector sent to instance 0x8d671b0'
*** First throw call stack:
(
0 CoreFoundation 0x017ed1e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x0156c8e5 objc_exception_throw + 44
2 CoreFoundation 0x0188a243 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
3 CoreFoundation 0x017dd50b ___forwarding___ + 1019
4 CoreFoundation 0x017dd0ee _CF_forwarding_prep_0 + 14
5 plistNeha 0x00002b7d -[sdViewController plistbtn:] + 333
6 libobjc.A.dylib 0x0157e880 -[NSObject performSelector:withObject:withObject:] + 77
7 UIKit 0x0022e3b9 -[UIApplication sendAction:to:from:forEvent:] + 108
8 UIKit 0x0022e345 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 61
9 UIKit 0x0032fbd1 -[UIControl sendAction:to:forEvent:] + 66
10 UIKit 0x0032ffc6 -[UIControl _sendActionsForEvents:withEvent:] + 577
11 UIKit 0x0032f243 -[UIControl touchesEnded:withEvent:] + 641
12 UIKit 0x0026dddd -[UIWindow _sendTouchesForEvent:] + 852
13 UIKit 0x0026e9d1 -[UIWindow sendEvent:] + 1117
14 UIKit 0x002405f2 -[UIApplication sendEvent:] + 242
15 UIKit 0x0022a353 _UIApplicationHandleEventQueue + 11455
16 CoreFoundation 0x0177677f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
17 CoreFoundation 0x0177610b __CFRunLoopDoSources0 + 235
18 CoreFoundation 0x017931ae __CFRunLoopRun + 910
19 CoreFoundation 0x017929d3 CFRunLoopRunSpecific + 467
20 CoreFoundation 0x017927eb CFRunLoopRunInMode + 123
21 GraphicsServices 0x037e15ee GSEventRunModal + 192
22 GraphicsServices 0x037e142b GSEventRun + 104
23 UIKit 0x0022cf9b UIApplicationMain + 1225
24 plistNeha 0x00002e1d main + 141
25 libdyld.dylib 0x01e34701 start + 1
26 ??? 0x00000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
Code:
NSString *path=[[NSBundle mainBundle]pathForResource:#"x" ofType:#"plist"];
ald=[[NSDictionary alloc]initWithContentsOfFile:path];
for(NSDictionary *awq in ald){
NSLog(#"check");
NSString *qqw=#"";
qqw=[awq objectForKey:#"qq"];
NSLog(#"%#",qqw);
}
But, if I am fetching data one by one then it is showing on debugger area. for in loop is also working as it is printing check. May be the line after NSLog(#"check"); is creating some exceptions.

Try this
NSString *path=[[NSBundle mainBundle]pathForResource:#"x" ofType:#"plist"];
NSDictionary *ald=[[NSDictionary alloc]initWithContentsOfFile:path];
for(NSDictionary *awq in [ald allValues]){
NSLog(#"check");
NSString *qqw=#"";
qqw=[awq objectForKey:#"qq"];
NSLog(#"%#",qqw);
}

for in on a dictionary is enumerating its keys, not values. See this question for each loop in objective c for accessing NSMutable dictionary

Try this:
NSString *path=[[NSBundle mainBundle]pathForResource:#"x" ofType:#"plist"];
NSDictionary *plistDictionary = [[NSDictionary alloc]initWithContentsOfFile:path];
for(NSString *key in plistDictionary){
NSDictionary *dictionary = [plistDictionary objectForKey:key];
NSLog(#"%#",[dictionary objectForKey:#"qq"]);
}
I had to change your variable names because it was too confusing to work with 'ald', 'awq', 'qqw' , etc.

Related

App crashes while using NSURL URLWithString in a "for" loop

Here's my code,
for (int i=0; i<=[selfLinksArray count]; i++) {
NSString *temp = selfLinksArray[i];
NSURL *tempURL = [NSURL URLWithString:temp ];
NSLog(#"NSURL:%#",tempURL);
NSData *tempData = [NSData dataWithContentsOfURL:tempURL];
NSError *error = nil;
NSDictionary *tempDict = [NSJSONSerialization JSONObjectWithData:tempData options:0 error:&error];
NSDictionary *volumeInfoDict = [tempDict objectForKey:#"volumeInfo"];
titleArray[i]=[volumeInfoDict objectForKey:#"title"];
}
Xcode shows me this error
[__NSArrayI length]: unrecognized selector sent to instance 0x7fdf334f0bc0
2016-01-19 16:12:34.937 BookFindr[7775:449799] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayI length]: unrecognized selector sent to instance 0x7fdf334f0bc0'
*** First throw call stack:
(
0 CoreFoundation 0x000000010f34be65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010edc4deb objc_exception_throw + 48
2 CoreFoundation 0x000000010f35448d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x000000010f2a190a ___forwarding___ + 970
4 CoreFoundation 0x000000010f2a14b8 _CF_forwarding_prep_0 + 120
5 CoreFoundation 0x000000010f32e261 _CFURLCreateWithURLString + 81
6 Foundation 0x000000010e97a465 -[NSURL(NSURL) initWithString:relativeToURL:] + 349
7 Foundation 0x000000010e97a2e2 +[NSURL(NSURL) URLWithString:relativeToURL:] + 59
8 BookFindr 0x000000010e8bf9ab -[tabResTableViewController viewDidLoad] + 219
9 UIKit 0x000000010f88ef98 -[UIViewController loadViewIfRequired] + 1198
10 UIKit 0x000000010f894f4f -[UIViewController __viewWillAppear:] + 120
11 UIKit 0x000000010f8c4e44 -[UINavigationController _startCustomTransition:] + 1203
12 UIKit 0x000000010f8d523f -[UINavigationController _startDeferredTransitionIfNeeded:] + 712
13 UIKit 0x000000010f8d63af -[UINavigationController __viewWillLayoutSubviews] + 57
14 UIKit 0x000000010fa7cff7 -[UILayoutContainerView layoutSubviews] + 248
15 UIKit 0x000000010f7af4a3 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 703
16 QuartzCore 0x000000011327b59a -[CALayer layoutSublayers] + 146
17 QuartzCore 0x000000011326fe70 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 366
18 QuartzCore 0x000000011326fcee _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
19 QuartzCore 0x0000000113264475 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 277
20 QuartzCore 0x0000000113291c0a _ZN2CA11Transaction6commitEv + 486
21 UIKit 0x000000010f6f2f7c _UIApplicationHandleEventQueue + 7329
22 CoreFoundation 0x000000010f277a31 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
23 CoreFoundation 0x000000010f26d95c __CFRunLoopDoSources0 + 556
24 CoreFoundation 0x000000010f26ce13 __CFRunLoopRun + 867
25 CoreFoundation 0x000000010f26c828 CFRunLoopRunSpecific + 488
26 GraphicsServices 0x0000000112b08ad2 GSEventRunModal + 161
27 UIKit 0x000000010f6f8610 UIApplicationMain + 171
28 BookFindr 0x000000010e8c101f main + 111
29 libdyld.dylib 0x0000000111a8792d start + 1
30 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
I have imported selfLinkArray from another viewController. I want to fetch various titles which are present in VolumeInfo dictionary. This dictionary is present in each individual link in selfLinksArray. Please help me with this error. Thanks in Advance.
Let's analyze your error and your backtrace :
-[__NSArrayI length]: unrecognized selector sent to instance 0x7fdf334f0bc0'
The issue is written here: the length method is called on an NSArray object.
Wait, this method is not even written in this sample! Don't worry, let's analyze it.
6 Foundation 0x000000010e97a465
-[NSURL(NSURL) initWithString:relativeToURL:] + 349
7 Foundation 0x000000010e97a2e2 +[NSURL(NSURL) URLWithString:relativeToURL:]
The crash log indicates that the crash occurs when you try to init the NSURL object. The only parameter of this init method is a NSString object. But are we sure that temp is really a NSString object ?
This variable is casted without checking if it's really an NSString object. It can be anthing, for example... the NSArray which receive a call to the length method. Also, this method is existing for a NSString object, so the unrecognizer selector error look totally related.
Where do you we call length on this NSString object ? My guess is, according to the backtrace, that URLWithString: call this method to check the NSString length in order to initialize properly the NSURL object.

Got a exception from play video based on local server! How to solve it?

program:
-(IBAction)playMV{
NSURL *url=[NSURL fileURLWithPath:[[NSBundle mainBundle]pathForResource:#"Pink_Try MV" ofType:#"mp4"]];
MPMoviePlayerViewController *playercontroller=[[MPMoviePlayerViewController alloc]initWithContentURL:url];
[self presentMoviePlayerViewControllerAnimated:playercontroller];
playercontroller.moviePlayer.movieSourceType=MPMovieSourceTypeFile;
[playercontroller.moviePlayer play];
playercontroller = nil;
}
exception:
2015-12-07 16:49:35.448 iMusic[4999:308040] -[mainPageViewController play]: unrecognized selector sent to instance 0x7ffaca4284a0
2015-12-07 16:49:35.454 iMusic[4999:308040] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[mainPageViewController play]: unrecognized selector sent to instance 0x7ffaca4284a0'
*** First throw call stack:
(
0 CoreFoundation 0x000000010ecc1f45 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010dec3deb objc_exception_throw + 48
2 CoreFoundation 0x000000010ecca56d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x000000010ec17eea ___forwarding___ + 970
4 CoreFoundation 0x000000010ec17a98 _CF_forwarding_prep_0 + 120
5 UIKit 0x000000010bc4ae91 -[UIApplication sendAction:to:from:forEvent:] + 92
6 UIKit 0x000000010bdb64d8 -[UIControl sendAction:to:forEvent:] + 67
7 UIKit 0x000000010bdb67a4 -[UIControl _sendActionsForEvents:withEvent:] + 311
8 UIKit 0x000000010bdb58d4 -[UIControl touchesEnded:withEvent:] + 601
9 UIKit 0x000000010bcb8ed1 -[UIWindow _sendTouchesForEvent:] + 835
10 UIKit 0x000000010bcb9c06 -[UIWindow sendEvent:] + 865
11 UIKit 0x000000010bc692fa -[UIApplication sendEvent:] + 263
12 UIKit 0x000000010bc43abf _UIApplicationHandleEventQueue + 6844
13 CoreFoundation 0x000000010ebee011 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
14 CoreFoundation 0x000000010ebe3f3c __CFRunLoopDoSources0 + 556
15 CoreFoundation 0x000000010ebe33f3 __CFRunLoopRun + 867
16 CoreFoundation 0x000000010ebe2e08 CFRunLoopRunSpecific + 488
17 GraphicsServices 0x000000010f7fbad2 GSEventRunModal + 161
18 UIKit 0x000000010bc4930d UIApplicationMain + 171
19 iMusic 0x000000010b47773f main + 111
20 libdyld.dylib 0x000000011100c92d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
It is likely that you have some problem with ref counts, enable zombies and malloc debugging and run in the debugger to see if you can track down what is going on. Based on the code snip you posted, it is unclear what is going on.

JSON Thumbnail image in Custom Table View Cell

I really get tired of trying to fix this so I think I need some help. I am filling each Cells of my iOS from an API which I successfully parsed (Can retrieve simple things such as texts, or numbers with no problem)
But when I tried to set the images for the thumbnails I am having some errors.
This is my code:
NSString *imageUrl = [tempDictionary valueForKeyPath:#"files.url_thumb"];
NSURL *url = [NSURL URLWithString:imageUrl];
NSData *imageData = [NSData dataWithContentsOfURL:url];
UIImage *thumbNailImage = [UIImage imageWithData:imageData];
dispatch_async(dispatch_get_main_queue(), ^{
[cell.ThumbImage setImage:thumbNailImage];
});
and this are the nightmares in my console:
2015-04-08 13:14:26.450 WebTableView[4976:173380] -[__NSArrayI length]:
unrecognized selector sent to instance 0x79e18b90
2015-04-08 13:14:26.509 WebTableView[4976:173380] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayI length]: unrecognized selector sent to instance 0x79e18b90'
*** First throw call stack:
(
0 CoreFoundation 0x036c9466 __exceptionPreprocess + 182
1 libobjc.A.dylib 0x03352a97 objc_exception_throw + 44
2 CoreFoundation 0x036d12c5 -[NSObject(NSObject) doesNotRecognizeSelector:] + 277
3 CoreFoundation 0x03619bc7 ___forwarding___ + 1047
4 CoreFoundation 0x0361978e _CF_forwarding_prep_0 + 14
5 CoreFoundation 0x035836cf CFStringGetLength + 143
6 CoreFoundation 0x036a9c8d _CFURLCreateWithURLString + 77
7 CoreFoundation 0x035952d3 CFURLCreateWithString + 35
8 Foundation 0x02f17999 -[NSURL(NSURL) initWithString:relativeToURL:] + 371
9 Foundation 0x02f17807 +[NSURL(NSURL) URLWithString:relativeToURL:] + 80
10 Foundation 0x02f177b1 +[NSURL(NSURL) URLWithString:] + 48
11 WebTableView 0x00111a8b -[TableViewController tableView:cellForRowAtIndexPath:] + 571
12 UIKit 0x01c26c9c -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 473
13 UIKit 0x01c26d7e -[UITableView _createPreparedCellForGlobalRow:willDisplay:] + 77
14 UIKit 0x01c0054b -[UITableView _updateVisibleCellsNow:isRecursive:] + 3034
15 UIKit 0x01c1aeb1 -[UITableView layoutSubviews] + 222
16 UIKit 0x01b907b1 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 608
17 libobjc.A.dylib 0x03368771 -[NSObject performSelector:withObject:] + 70
18 QuartzCore 0x009421cf -[CALayer layoutSublayers] + 152
19 QuartzCore 0x00936055 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 397
20 QuartzCore 0x00935eb0 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 26
21 QuartzCore 0x008941b6 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 284
22 QuartzCore 0x0089558a _ZN2CA11Transaction6commitEv + 392
23 QuartzCore 0x00895c56 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92
24 CoreFoundation 0x035ec18e __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
25 CoreFoundation 0x035ec0d0 __CFRunLoopDoObservers + 400
26 CoreFoundation 0x035e1b0a __CFRunLoopRun + 1226
27 CoreFoundation 0x035e137b CFRunLoopRunSpecific + 443
28 CoreFoundation 0x035e11ab CFRunLoopRunInMode + 123
29 GraphicsServices 0x04b3d2c1 GSEventRunModal + 192
30 GraphicsServices 0x04b3d0fe GSEventRun + 104
31 UIKit 0x01b049b6 UIApplicationMain + 1526
32 WebTableView 0x000dd6cd main + 141
33 libdyld.dylib 0x03e94ac9 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
I think valueForKeyPath: returning an array of objects. Try logging imageUrl and check what you are getting.
If you are confident that there would be only one url then you can try this -
NSString *imageUrl = [[tempDictionary valueForKeyPath:#"files.url_thumb"] lastObject];
Else try something like this -
valueForKey:#"files"] valueForKey:#"url_thumb]

Add empty object to an array

I need to add an empty object to index 0 and index 1 of an array being populated with data from a third party XML feed.
This is my parseXML method, it works.
-(void) parseXML{
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:#"APIKEYHERECANTSHOW YOU"]];
NSData *response = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];
NSString *xmlString = [[NSString alloc] initWithData:response encoding:NSUTF8StringEncoding];
NSLog(#"The string : %#", xmlString);
NSDictionary *xml = [NSDictionary dictionaryWithXMLString:xmlString];
NSLog(#"The dict:%#", xml);
NSMutableDictionary *PageItem = [xml objectForKey:#"TeamLeagueStanding"];
NSLog(#"PageItem: %#", PageItem);
NSMutableArray *items = [xml objectForKey:#"TeamLeagueStanding"];
NSNull *nullValue = [NSNull null];
[items insertObject:nullValue atIndex:0]; <- THIS MAKES MY APP CRASH
NSLog(#"The array: %#", items);
[self setTableData:items];
}
But when i run this i get a crash with the console output:
2014-02-03 21:24:09.063 Liga Zon Sagres Companion[9645:70b] -[NSNull objectForKey:]: unrecognized selector sent to instance 0x101a85b40
2014-02-03 21:24:09.066 Liga Zon Sagres Companion[9645:70b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSNull objectForKey:]: unrecognized selector sent to instance 0x101a85b40'
*** First throw call stack:
(
0 CoreFoundation 0x000000010192a795 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010168d991 objc_exception_throw + 43
2 CoreFoundation 0x00000001019bbbad -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x000000010191c09d ___forwarding___ + 973
4 CoreFoundation 0x000000010191bc48 _CF_forwarding_prep_0 + 120
5 Liga Zon Sagres Companion 0x000000010000ee20 -[StandingsTableViewController tableView:cellForRowAtIndexPath:] + 256
6 UIKit 0x00000001003bbb8a -[UITableView _createPreparedCellForGlobalRow:withIndexPath:] + 348
7 UIKit 0x00000001003a3836 -[UITableView _updateVisibleCellsNow:] + 2297
8 UIKit 0x00000001003b4381 -[UITableView layoutSubviews] + 207
9 UIKit 0x000000010034bb27 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 354
10 QuartzCore 0x0000000102081a22 -[CALayer layoutSublayers] + 151
11 QuartzCore 0x0000000102076589 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 363
12 QuartzCore 0x0000000102081956 -[CALayer layoutIfNeeded] + 162
13 UIKit 0x00000001003ebfc2 -[UIViewController window:setupWithInterfaceOrientation:] + 264
14 UIKit 0x000000010032ab4d -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:isRotating:] + 4360
15 UIKit 0x0000000100329a3f -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:] + 36
16 UIKit 0x000000010032998f -[UIWindow _setRotatableViewOrientation:updateStatusBar:duration:force:] + 101
17 UIKit 0x0000000100328c9e -[UIWindow _updateToInterfaceOrientation:duration:force:] + 377
18 UIKit 0x00000001003dfd4a -[UIViewController _tryBecomeRootViewControllerInWindow:] + 147
19 UIKit 0x0000000100323a87 -[UIWindow addRootViewControllerViewIfPossible] + 506
20 UIKit 0x0000000100323bd5 -[UIWindow _setHidden:forced:] + 275
21 UIKit 0x000000010032cca2 -[UIWindow makeKeyAndVisible] + 51
22 UIKit 0x00000001002eb0c8 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1449
23 UIKit 0x00000001002eebe8 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 660
24 UIKit 0x00000001002ffaab -[UIApplication handleEvent:withNewEvent:] + 3092
25 UIKit 0x00000001002fff1e -[UIApplication sendEvent:] + 79
26 UIKit 0x00000001002f02be _UIApplicationHandleEvent + 618
27 GraphicsServices 0x0000000102578bb6 _PurpleEventCallback + 762
28 GraphicsServices 0x000000010257867d PurpleEventCallback + 35
29 CoreFoundation 0x00000001018ac819 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 41
30 CoreFoundation 0x00000001018ac5ee __CFRunLoopDoSource1 + 478
31 CoreFoundation 0x00000001018d5ab3 __CFRunLoopRun + 1939
32 CoreFoundation 0x00000001018d4f33 CFRunLoopRunSpecific + 467
33 UIKit 0x00000001002ee4bd -[UIApplication _run] + 609
34 UIKit 0x00000001002f0043 UIApplicationMain + 1010
35 Liga Zon Sagres Companion 0x0000000100011f93 main + 115
36 libdyld.dylib 0x0000000102f815fd start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Any ideas how to solve this? Thank you.
The error is coming from your StandingsTableViewController tableView:cellForRowAtIndexPath: method. Your data is giving you an NSNull instance where you expect an NSDictionary.
Since you explicitly add the NSNull object you need to update your cellForRow... method to check to see if the object is an NSNull instance before assuming it is an NSDictionary.
Something like this:
NSDictionary *data = self.tableData[someIndex];
if ([data isKindOfClass:[NSDictionary class]]) {
// process the data as usual
} else {
// This is probably the NSNull object, ignore it or handle appropriately
}

Why unknown selector when calling JSONRPC on XBMC?

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 :)

Resources