YRMsgMainModel.m 905 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. //
  2. // YRMsgMainModel.m
  3. // UU_Ent
  4. //
  5. // Created by liujl on 2019/4/29.
  6. // Copyright © 2019 UAS. All rights reserved.
  7. //
  8. #import "YRMsgMainModel.h"
  9. @implementation YRMsgMainModel
  10. /**
  11. 匹配目标控制器
  12. */
  13. -(void)setCode:(NSString *)code{
  14. _code = code;
  15. NSString *path = [[NSBundle mainBundle]pathForResource:@"msg_route" ofType:@"json"];
  16. NSData *data = [[NSData alloc]initWithContentsOfFile:path];
  17. NSError *error = nil;
  18. NSDictionary *routeDic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:&error];
  19. NSArray *routeArr = routeDic[@"data"];
  20. for (NSDictionary *dic in routeArr) {
  21. if ([_code isEqualToString:dic[@"code"]]) {
  22. self.desVC = dic[@"desVc"];
  23. }
  24. }
  25. }
  26. @end