Comment obtenir la valeur booléenne de JSON?

Suppose que c'est une valeur dans un JSON je veux attribuer à une variable BOOLEAN:

"retweeted": false

Voici comment j'ai analyser les données JSON:

NSError *error;
NSArray *timeline = [NSJSONSerialization JSONObjectWithData:responseData options:NSJSONReadingMutableLeaves error:&error];

Maintenant, j'ai un bool propriété définie comme:

BOOL *retweeted;

À l'intérieur de ma classe. Quand je le faire lors de l'analyse du JSON:

tweet.retweeted = [[[timeline objectAtIndex:i] objectForKey:@"retweeted"] boolValue];

J'obtiens cette erreur:

Comment obtenir la valeur booléenne de JSON?

Comment résoudre ce problème?

boolean devrait être défini comme BOOL retweeted;

OriginalL'auteur Richard Knop | 2012-04-07