- bundleInfo = [self _loadBundleInfoAtExistingPath:infoPath];
- }
- if (debugOn) {
- NSLog(@"found info for path=%@ info=%@: %@",
- tmp, infoPath, bundleInfo);
- }
-
- providedResources =
- [[(NSDictionary *)[bundleInfo objectForKey:@"provides"]
- objectForKey:_type]
- objectEnumerator];
- if (providedResources == nil) continue;
-
- // scan provide array
- while ((info = [providedResources nextObject])) {
- if (rnKeys) {
- if (!_doesInfoMatch(rnKeys, _resourceName, info))
- continue;
- }
- else {
- NSString *name;
-
- name = [[(NSDictionary *)info objectForKey:@"name"] stringValue];
- if (name == nil) continue;
- if (![name isEqualToString:_resourceName]) continue;
- }
-
- if (_selector) {
- if (!_selector(_resourceName, _type, tmp, info, self, _context))
- continue;
- }
- /* all conditions applied */
- return tmp;
- }
- }