| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- //
- // FavoritesViewController.m
- // Apex Mobile
- //
- // Created by Ray on 14-4-25.
- // Copyright (c) 2014年 United Software Applications, Inc. All rights reserved.
- //
- #import "FavoritesViewController.h"
- @interface FavoritesViewController ()
- @end
- @implementation FavoritesViewController
- - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
- {
- self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
- if (self) {
- // Custom initialization
- }
- return self;
- }
- - (void)viewDidLoad
- {
- [super viewDidLoad];
-
-
- self.data =[[FavoritesData alloc]init];
- [self.tableview reloadData];
-
- }
- -(void)viewWillAppear:(BOOL)animated
- {
- }
- - (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.
- }
- */
- - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
- {
-
- return 1;
- }
- - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
- {
-
- return [self.data get_count];
-
-
- }
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
- {
- DebugLog(@"cellForRowAtIndexPath");
-
- NSString *CellIdentifier = @"cell_item_history";
- CellItemHistory *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
- NSString* name = [self.data.pagedata[indexPath.row] valueForKey:@"name"];
- NSString* create_time = [self.data.pagedata[indexPath.row] valueForKey:@"create_time"];
-
-
- cell.name.text = name;
- [cell.name sizeToFit];
-
- cell.time.text =create_time;
- [cell.time sizeToFit];
-
- // cell.imageView.image = [UIImage imageNamed:[self.toolsinfo[indexPath.row] valueForKey:@"img"]];
-
- return cell;
-
-
- }
- - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
- {
-
- // NSMutableDictionary *params = [[NSMutableDictionary alloc] initWithDictionary:self.params copyItems:true];
-
-
- NSString* str_params =[self.data.pagedata[indexPath.row] valueForKey:@"params"];
- NSData* data_params = [str_params dataUsingEncoding:NSUTF8StringEncoding];
-
-
-
- NSMutableDictionary* params = [[NSMutableDictionary alloc] initWithDictionary:[NSJSONSerialization
- JSONObjectWithData:data_params
- options:NSJSONReadingMutableLeaves
- error:nil] copyItems:true];
-
-
- NSString * str_actions =[self.data.pagedata[indexPath.row] valueForKey:@"action"];
- NSArray* actions = [str_actions componentsSeparatedByString:@","];
-
- NSString* function_name = [self.data.pagedata[indexPath.row] valueForKey:@"module_name"];
-
- DetailTabBarController *detailViewController=[[DetailTabBarController alloc] init:function_name actions:actions params:params];
-
-
- // DetailTabBarController *detailViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"DetailTabBarController"];
- // detailViewController.function_name = self.function_name;
- // detailViewController.actions = self.actions;
- // detailViewController.params =params;
- [self.navigationController pushViewController:detailViewController animated:YES];
- }
- @end
|