Reputation: 3298
I get an error saying:
"no visible @interface for 'NSData' declares the selector 'JSONValue'"
??
It happens when I have a data stream (NSDAta) NSDictionary * dict = [data JSONValue];
I have only the SBJson files that came with the facebook SDK. Can someone help me understand what is happening.
Upvotes: 0
Views: 1530
Reputation: 89509
Your "data" should actually be a "NSString
" object.
Then you can do something like this (assuming the JSON data is in the variable named "data"):
NSString *json_string = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
if(json_string)
{
NSDictionary * facebookDict = [json_string JSONValue];
}
Also make sure you "#import "NSString+SBJSON.h"
" at the top of the .m file this code lives in.
Upvotes: 1