0

I want to retrieve the different tag values in an NSString.

NSString *test      =  

{
    "data": [
        {
            "id": "100002319144563_125257217561582",
            "from": {
                "name": "Umair Ahmed",
                "id": "100002319144563"
            },
            "message": "Hello Umair Here",
            "actions": [
                {
                    "name": "Comment",
                    "link": "http://www.facebook.com/100002319144563/posts/125257217561582"
                },
                {
                    "name": "Like",
                    "link": "http://www.facebook.com/100002319144563/posts/125257217561582"
                }
            ],
            "privacy": {
                "description": "Everyone",
                "value": "EVERYONE"
            },
            "type": "status",
            "application": {
                "name": "iPhone",
                "id": "213257025359930"
            },
            "created_time": "2011-07-08T11:59:15+0000",
            "updated_time": "2011-07-08T11:59:15+0000"
        },
        {
            "id": "100002319144563_125251050895532",
            "from": {
                "name": "Umair Ahmed",
                "id": "100002319144563"
            },
            "message": "Hello testing testing",
            "actions": [
                {
                    "name": "Comment",
                    "link": "http://www.facebook.com/100002319144563/posts/125251050895532"
                },
                {
                    "name": "Like",
                    "link": "http://www.facebook.com/100002319144563/posts/125251050895532"
                }
            ]
        }
    ]
}

How can I retrieve the name and message tag values into an array or dictionary?

1 Answer 1

2

It looks like a JSON string, so just use one of JSON libraries, like TouchJSON or JSONKit and you can easily extract the data from the structures they will provide you.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.