0

I am working on Project to Parse Facebook Graph API response in Xcode. Got Success in getting response but I am newBee to Parse Facebook API response via Xcode.

{
  "data": [
    {
      "category": "Sports", 
      "name": "TennisClubbers", 
      "access_token": "CAACEdEose0cBACQZCQkbeQjW4NpjxTHU6Hdr4vErEhvAQhAlraGJuNkoa76tXn9keSFGGRW2YXEaPe6LzNwkOeN9YFFX02g7QvHDbmUFeYcFh2oEjAHrdgmxyEL9NwvTH7R5B3LKvILhfZCpluLg6VjLcYBsNmOxKKOhFVqusJtblDzv7zoZAJC2GkEmdXs1R65f9meVwZDZD", 
      "perms": [
        "ADMINISTER", 
        "EDIT_PROFILE", 
        "CREATE_CONTENT", 
        "MODERATE_CONTENT", 
        "CREATE_ADS", 
        "BASIC_ADMIN"
      ], 
      "id": "330130543706625"
    }, 
    {
      "category": "Sports", 
      "name": "SoccerClubbers", 
      "access_token": "CAACEdEose0cBAAVinXUUr6nzZCJeWExBPOYV3RltkutoDLOMcsqh4o52Cg0utC15HJI20u9ezFMsIl9SquVVZBWWHIbTC36U0PH8K9k0rgCANxSafdkuDE71sluPuFqPF4sVsO3tnlKu7DsxQf9TjKEZAVrl0sIouZBGMkopcVllaT1ARhg3SDFIyQZAyxKrZCRHxitnIFsgZDZD", 
      "perms": [
        "ADMINISTER", 
        "EDIT_PROFILE", 
        "CREATE_CONTENT", 
        "MODERATE_CONTENT", 
        "CREATE_ADS", 
        "BASIC_ADMIN"
      ], 
      "id": "239810846118768"
    }
  ], 

Can anyone share XCode lines to parse Facebook API response Data & get Category,Names & ID in separate variables.

  • I would suggest looking at one of the many existing JSON parsers out there. See: http://stackoverflow.com/questions/286087/best-json-library-to-use-when-developing-an-iphone-application – picciano Sep 24 '13 at 16:12

1 Answers1

0

I have previously used Parse in one of my project. I don't remember correctly but I guess If you are using FBRequest to obtain the above data, then they should be already parsed. In other words the data you have got should already be parsed in NSDictionary or NSArray depending on json data's root object.

If not you can easily parse a json data using NSJSONSerialization class provided by ios

Gaurav Singh
  • 1,897
  • 14
  • 22
  • Can you share code to Parse it if possible - Waiting – user2798898 Sep 24 '13 at 18:20
  • For json serialization check this [link](http://stackoverflow.com/questions/8356842/how-to-use-nsjsonserialization) – Gaurav Singh Sep 24 '13 at 18:31
  • Check this parse.com [documentation](https://www.parse.com/tutorials/integrating-facebook-in-ios) especially the section "Requesting and Setting User Data". Here you can see the response received from facebook ios sdk is already parsed. – Gaurav Singh Sep 24 '13 at 18:43