Thursday, May 30, 2013

проверить на соответствие одного объекта, объктам в массиве

      NSString *runningAthlete1 = [[[[sportResult.matchDetails objectForKey:@"unitInfo"] objectForKey:@"currentPair"] objectForKey:@"innerAthlete"] objectForKey:@"odfCode"];
            NSString *runningAthlete2 = [[[[sportResult.matchDetails objectForKey:@"unitInfo"] objectForKey:@"currentPair"] objectForKey:@"outerAthlete"] objectForKey:@"odfCode"];
            NSString *runningAthlete3 = [[[[sportResult.matchDetails objectForKey:@"unitInfo"] objectForKey:@"nextPair"] objectForKey:@"innerAthlete"] objectForKey:@"odfCode"];
            NSString *runningAthlete4 = [[[[sportResult.matchDetails objectForKey:@"unitInfo"] objectForKey:@"nextPair"] objectForKey:@"outerAthlete"] objectForKey:@"odfCode"];
            
            NSArray *currentAthletes = @[runningAthlete1,runningAthlete2,runningAthlete3,runningAthlete4];

            for (int i = 0; i < fullListAthletes.count; i++) {
                          
                if ([currentAthletes containsObject:[[[fullListAthletes objectAtIndex:i] objectForKey:@"athlete"] objectForKey:@"odfCode"]]) {
                    [fullListAthletes removeObjectAtIndex:i];
                    i--;
                }
                
                 NSLog(@"123");

            }

No comments:

Post a Comment