Advertisement
Larme

Untitled

Jun 24th, 2021
1,941
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     NSString *targetId = @"toFind";
  2.     NSMutableArray *results = [NSMutableArray new];
  3.     for (NSDictionary *element in _categoryDictionary) {
  4.         NSArray *subcategories = element[@"subcategories"];
  5.         for (NSDictionary *aSubcategory in subcategories) {
  6.             if ([aSubcategory[@"id"] isEqualToString:targetId]) {
  7.                 [results addObject:aSubcategory[@"locale"]];
  8.             }
  9.         }
  10.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement