I want to load JSON data through multithreading and parse it to NSDictionary, have done it previously using TWRequest class for twitter feeds, How can I use NSURLRequest to do the same as:
TWRequest *request = [[TWRequest alloc] initWithURL:[NSURL URLWithString: @"https://api.twitter.com/1/statuses/public_timeline.json?screen_name=firdous_ali86&include_entities=true"] parameters:nil requestMethod:TWRequestMethodGET];
// Notice this is a block, it is the handler to process the response
[request performRequestWithHandler:^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error)
{
if ([urlResponse statusCode] == 200)
{
tweetCollection = [[NSMutableArray alloc] init];
Tweet *tweet;
NSError *error;
NSArray *dict = [NSJSONSerialization JSONObjectWithData:responseData options:0 error:&error];
}
}];
problem is that NSURLRequest doesnt implement performRequestWithHandler method.
i used: