I have a variable which is printing its value on console like this:
source id key is (
{ name = "ABC Rawal"; uid = 10000048171452;}
)
This is the code I’m using to do that:
-(void)request:(FBRequest*)request didLoad:(id)result {
NSLog(@"source id key is %@", result);
}
I have to get name and uid separately. How can I retrieve those value from result?
resultis an array comprised of dictionaries. In your example, the array has only one element.If you want only the first element in the array, then:
Or, if you want to iterate over all elements in the array — in case the array has more than one element — then:
Note that from your output it’s not possible to know whether
uidis a string or a number. The code above considers it’s a string; in case it’s a number, use:or an appropriate integer type that can hold the range of possible values.