Search code examples
iosxmlxcodetwitter

Twitter client, in reply to id


id = *********;
"in_reply_to_screen_name"= stackoverflow

Above you can see two examples of information I receive from the twitter API. I need to know how to get the value id.

To get in_reply_to_screen_name I use

-(NSString*)profileName {

return [contents objectForKey:@"in_reply_to_screen_name"];
}

How would I do this for id? The only difference is the profileName is in " " where the id isn't.

Any help would be appreciated


Solution

  • It depends in my experience whether you're getting the data as JSON or XML but generally the number will end up decoded as an NSNumber so I use:

    return [[contents objectForKey:@"in_reply_to_id"] unsignedLongLongValue];