Hi, I am captur开发者_开发问答ing the Facebook details in string format, but I want id and username only. How do I separate this data out. My data is:
the fbString is
{
"id":"100002257451995",
"name":"Mustacheiphone Mustache",
"first_name":"Mustacheiphone",
"last_name":"Mustache",
"link":"http:\/\/www.facebook.com\/profile.php?id=100002257451995",
"gender":"male","email":"mustacheiphone\u0040gmail.com",
"timezone":5.5,"locale":"en_US","verified":true,
"updated_time":"2011-04-11T11:28:22+0000"
}
i got it this way i was capture the userid
SBJsonParser *parser = [[SBJsonParser alloc]init];
NSDictionary *facebookInfo = [[parser objectWithString:fbString error:nil] copy];
[parser release];
if(facebookInfo != nil)
{
//NSDictionary *data = (NSDictionary *) [facebookInfo objectAtIndex:0];
NSString *faceBoookID = (NSString *) [facebookInfo objectForKey:@"id"];
NSLog(@"the faceBookID is %@",faceBoookID);
// appDelegate.FBID = faceBoookID;
NSString *useremail = (NSString *) [facebookInfo objectForKey:@"email"];
NSLog(@"the faceBookemail is %@",useremail);
// appDelegate.FBEMAIL = useremail;
}
精彩评论