// // symbol.m // jiaPei // // Created by apple on 16/1/5. // Copyright © 2016年 JCZ. All rights reserved. // #import "symbol.h" #import "symbolCell.h" #import "ChildSymbolVC.h" @interface symbol () { NSArray *titleArray; NSArray *countArray; } @end @implementation symbol - (void)viewDidLoad { [super viewDidLoad]; //这是交通类型子类型页面 self.title = @"交通标志"; [self configNavigationBar]; titleArray = @[@"禁令标志",@"警告标志",@"指示标志",@"指路标志",@"道路施工安全标志",@"旅游区标志",@"辅助标志",@"禁止标线",@"警告标线",@"指示标线",@"道路安全设施设置"]; countArray = @[@"42",@"48",@"29",@"126",@"26",@"17",@"16",@"24",@"13",@"33",@"15"]; UITableView *mainTableView = [[UITableView alloc] initWithFrame:kFrame style:UITableViewStylePlain]; mainTableView.height -= kNavOffSet; mainTableView.delegate = self; mainTableView.dataSource = self; mainTableView.rowHeight = SGFloat(50); [self.view addSubview:mainTableView]; mainTableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine; [mainTableView registerClass:[symbolCell class] forCellReuseIdentifier:@"cell"]; } #pragma mark tableView delegate -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return titleArray.count; } -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { symbolCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"]; [cell setSelectionStyle:UITableViewCellSelectionStyleNone]; [cell.image setImage:[UIImage imageNamed:[NSString stringWithFormat:@"1-%d-1.jpg",(int)indexPath.row + 1]]]; cell.titleLabel.text = titleArray[indexPath.row]; cell.countLabel.text = countArray[indexPath.row]; [cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator]; return cell; } -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { ChildSymbolVC *childSym = [[ChildSymbolVC alloc] init]; childSym.rowTag = indexPath.row; childSym.MI_GROUP = @"1"; childSym.MI_TYPE = [NSString stringWithFormat:@"%d",(int)indexPath.row + 1]; [self navPushHideTabbarToVC:childSym]; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } /* #pragma mark - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { // Get the new view controller using [segue destinationViewController]. // Pass the selected object to the new view controller. } */ @end