Question: Good day everyone! I would just want to ask what is wrong with what I am doing. I am working with this for two days and yet I still can't make it. It says "unrecognized selector sent to instance 0x748b800". 
What I am doing is parsing a json returned value. Below is the sample json returned value:

```
{
   "data": [
      {
         "name": "John Patola",
         "id": "123444432"
      },
      {
         "name": "Joshua Valdez",
         "id": "22234567778"
      }
]
}

```

I want to store them in an array called
 `NSArray *storage`.
Below are my codes:

```
-(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data{
[self.rData appendData:data];
}
-(void)connection: (NSURLConnection *)connection didFailWithError:(NSError *)error{
[rData release];
[connection release];
}
-(void)connectionDidFinishLoading:(NSURLConnection *)connection{
NSString *myVar = [[[NSString alloc] initWithData:rData encoding:NSUTF8StringEncoding] autorelease];
NSArray *storage =[[(NSDictionary *)myVar objectForKey:@"data"]retain]; // this line seems to be the error
NSLog(@"%i", [storage count]);

```

When I run this code, I got an error "unrecognized selector sent to instance 0x748b800". Do you think that the line I've marked really gives error? How can I fix it? Thank you for your help in advance. ;-)

Answer: 
Add `JSON` kit in your project.

Declare a method in your `viewController.h` file

```
-(void)JsonParsing:(NSString *)string;

```

Then import 

```
#import "SBJSON.h"
#import "JSON.h"

```

in your `viewController.m` file and 

```
-(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
{
    [self.rData appendData:data];
}
-(void)connection: (NSURLConnection *)connection didFailWithError:(NSError *)error
{
    [rData release];
    [connection release];
}
-(void)connectionDidFinishLoading:(NSURLConnection *)connection
 {
    NSString *theXMLString = [[NSString alloc]initWithBytes:[self.rData mutableBytes] length:[self.rData length] encoding:NSUTF8StringEncoding];
    [self JsonParsing:theXMLString];
 }

```

Then parse your string here - 

```
-(void)JsonParsing:(NSString *)string
{
    SBJSON *jsonObject = [[SBJSON alloc]init];
    NSArray *dataArray = [[NSArray alloc]init];
    dataArray = [jsonObject objectWithString:string];
    NSLog(@"%d", [dataArray count]);

}

```
Do this:

```
 -(void)connectionDidFinishLoading:(NSURLConnection *)connection{

   NSError *error = nil;
   NSDictionary *jsonDict = [NSJSONSerialization JSONObjectWithData: rData options: NSJSONReadingMutableContainers error: &error];

   if (!jsonArray) {
      NSLog(@"Error parsing JSON data: %@", e);
   } else 
   {
      NSArray *arrValues = [jsonDict objectForKey:@"data"];
      for(NSDictionary *item in arrValues) {
      NSLog(@"Item: %@", item);
   }
}

```