YRMineModel.m 1000 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. //
  2. // YRMineModel.m
  3. // UU_Ent
  4. //
  5. // Created by huangyp-pc on 2019/5/7.
  6. // Copyright © 2019 UAS. All rights reserved.
  7. //
  8. #import "YRMineModel.h"
  9. @implementation YRMineModel
  10. /**
  11. 匹配目标控制器
  12. */
  13. -(void)setId_p:(NSString *)id_p
  14. {
  15. _id_p = id_p;
  16. NSString *path = [[NSBundle mainBundle]pathForResource:@"mine_route" ofType:@"json"];
  17. NSData *data = [[NSData alloc]initWithContentsOfFile:path];
  18. NSError *error = nil;
  19. NSDictionary *routeDic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:&error];
  20. NSArray *routeArr = routeDic[@"data"];
  21. for (NSDictionary *dic in routeArr) {
  22. if ([_id_p isEqualToString:dic[@"id_p"]]) {
  23. self.desVC = dic[@"desVc"];
  24. }
  25. }
  26. //如果没找到,则用服务器返回的类型控制器名
  27. if (!self.desVC) {
  28. self.desVC = self.iosWidget;
  29. }
  30. }
  31. @end