NSMutableDictionary *t = [[NSMutableDictionary alloc] init ];
NSMutableArray *names = [NSMutableArray array];
// t にインデックスを、その名前が呼ばれたかどうかを判別させるためのマップを作る。
while([self.dummyPerson count] != 3){
int r = arc4random() % [self.followers count];
NSMutableDictionary *follower = [self.followers objectAtIndex:r];
NSString *fName = [follower valueForKey:@"screen_name"];
// もしも、その名前が存在していなかったら、作る。
if (![t valueForKey:fName]){
[self.dummyPerson addObject:[self.followers objectAtIndex:r]];
}
[t setValue:@"exist" forKey:[self screenNameAt:r]];
}
More than 5 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme