for (NSDictionary *fbDictionary in self.latestReactionsArray) {

    LatestReaction *latestReaction = [[LatestReaction alloc]init];

    NSDictionary *subFBDictionary = [fbDictionary objectForKey:@"participant"];

    NSString *facebookUserID = [subFBDictionary valueForKey:@"facebook_id"];

    NSNumber* reactionIDNum = [fbDictionary valueForKey:@"reaction_id"];

    int reactionID = [reactionIDNum intValue];

    NSLog(@"what is name%@ and %@ and %d",facebookUserID, self.latestReactionsArray,reactionID);
}


我想将所有[fbDictionary valueForKey:@"reaction_id"]保存在数组或字典中。我该怎么做呢?谢谢。

最佳答案

尝试这个:

NSArray *reactionIDs = [self.latestReactionsArray valueForKey:@"reaction_id"];


这将为您提供一系列反应ID。

10-06 10:51