// // YRMsgMainModel.m // UU_Ent // // Created by liujl on 2019/4/29. // Copyright © 2019 UAS. All rights reserved. // #import "YRMsgMainModel.h" @implementation YRMsgMainModel /** 匹配目标控制器 */ -(void)setCode:(NSString *)code{ _code = code; NSString *path = [[NSBundle mainBundle]pathForResource:@"msg_route" ofType:@"json"]; NSData *data = [[NSData alloc]initWithContentsOfFile:path]; NSError *error = nil; NSDictionary *routeDic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:&error]; NSArray *routeArr = routeDic[@"data"]; for (NSDictionary *dic in routeArr) { if ([_code isEqualToString:dic[@"code"]]) { self.desVC = dic[@"desVc"]; } } } @end