Question: <http://www.flickr.com/photos/fraserspeirs/4329430635/in/set-72157623224262135/>

The above is a link basically showing the form fill view of the numbers app on the iPad. Any idea as to how to achieve such a functionality which sort of looks like our vanilla tabs on Chrome?

Answer: 
You most likely have the same issue as me... The returning data is in JSONP format instead of pure JSON. In other words you will be dealing with something like

```
functionCall({"Name": "Foo", "Id" : 1234, "Rank": 7});

```

instead of just

```
{"Name": "Foo", "Id" : 1234, "Rank": 7}

```

More info [here](http://en.wikipedia.org/wiki/JSONP)

You'll need to strip the function and parentheses from the string before parsing it through the JSON Framework. You can do that with the following Regular Expression (spaced out to make it easier to see):

```
\w+ \s? \( ( \{ .* \} ) \}

```

And the script to write this is:

```
NSError *error = NULL;
NSRegularExpression *regex = [NSRegularExpression
    regularExpressionWithPattern:@"\\w+\\s?\\((\\{.*\\})\\)"
                         options:NSRegularExpressionCaseInsensitive
                           error:&error];

[regex replaceMatchesInString:resultString
                      options:0
                        range:NSMakeRange(0, [resultString length])
                 withTemplate:@"$1"];

NSLog(@"resultString = %@", resultString);
NSLog(@"converted = %@", [resultString JSONValue]);

```

where `resultString` is the response from the url request... It has to be stored as an `NSMutableString` in order for the regex to update it.
actually am not creating the json object by using api am retrieving it..

now i found the reason for that error. am not giving valid json object to covert into nsdictionary...So for getting valid json object we have to produce valid url to retrieve json object.

thanks for your suggestion...