0
votes

I'm trying to use the Twitter plugin for iOS to enable retweeting in my application. I'm using the getTWRequest method to do so, and the retweet works, but when the plugin tries to parse the response from twitter (which appears to be a valid JSON string when logged out to console) the following error is thrown:

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString objectFromJSONString]: unrecognized selector sent to instance...

This error seems to be triggered by the following line:

NSDictionary *dict = [dataString objectFromJSONString];

Does anyone know what may be causing this?

1
do a NSLog(@"%@" , [dataString class]) to see if dataString is NSString or notYann86

1 Answers

1
votes

Maybe you should change

NSDictionary *dict = [dataString objectFromJSONString];

to

NSDictionary *dict = [dataString JSONObject];

Please refer to Switch JSON serialization to NSJSONSerialization