我在为分段的UITableView
传递数组值时遇到了困难此代码适用于我
LandingMenu *landing0 = [[LandingMenu alloc]init];
[landing0 setMenuTitle:@"For Verification"];
[landing0 setMenuTotalCount:[NSString stringWithFormat:@"%i",20]];
[landing0 setMenuColorCode:[NSNumber numberWithInt:0]];
LandingMenu *landing6 = [[LandingMenu alloc]init];
[landing6 setMenuTitle:@"For Approval"];
[landing6 setMenuTotalCount:[NSString stringWithFormat:@"%i",5]];
[landing6 setMenuColorCode:[NSNumber numberWithInt:0]];
_taskList = [NSMutableArray arrayWithObjects:landing0, landing6, nil];
LandingMenu *landing1 = [[LandingMenu alloc]init];
[landing1 setMenuTitle:@"Fund Transfer Own"];
[landing1 setMenuTotalCount:[NSString stringWithFormat:@"%i",9]];
[landing1 setMenuType:[NSNumber numberWithInt:0]];
LandingMenu *landing2 = [[LandingMenu alloc]init];
[landing2 setMenuTitle:@"Fund Transfer Third Party"];
[landing2 setMenuTotalCount:[NSString stringWithFormat:@"%i",5]];
[landing2 setMenuType:[NSNumber numberWithInt:0]];
LandingMenu *landing3 = [[LandingMenu alloc]init];
[landing3 setMenuTitle:@"Checkbook Reorder"];
[landing3 setMenuTotalCount:[NSString stringWithFormat:@"%i",5]];
[landing3 setMenuType:[NSNumber numberWithInt:1]];
LandingMenu *landing4 = [[LandingMenu alloc]init];
[landing4 setMenuTitle:@"Stop Payment Order"];
[landing4 setMenuTotalCount:[NSString stringWithFormat:@"%i",6]];
[landing4 setMenuType:[NSNumber numberWithInt:0]];
_forVerificationList = [NSMutableArray arrayWithObjects:landing1, landing2, landing4, nil];
_forApprovalList = [NSMutableArray arrayWithObjects:landing3, nil];
[_menuList addObject:[[NSArray alloc] initWithObjects:landing1, landing2, landing4, nil]];
[_menuList addObject:[[NSArray alloc] initWithObjects:landing3, nil]];
现在,我遇到了如何转换上述指定输出的问题。假设此代码来自JSON对象。
for (NSDictionary *dictCQ in taskJson) {
NSLog(@"TASKLIST: %@", [dictCQ objectForKey:@"foTaskListModelWs"]);
NSDictionary *datadic = [dictCQ objectForKey:@"foTaskListModelWs"];
TaskList *task = [[TaskList alloc]init];
[task setCount:datadic[@"count"]];
[task setFuncCd:datadic[@"funcCd"]];
[task setFuncCdDscp:datadic[@"funcCdDscp"]];
[task setRequestStatus:datadic[@"requestStatus"]];
[task setRole:datadic[@"role"]];
[taskList addObject:task];
}