// // BaseTableViewController.m // IBOSS // // Created by iHope on 14-7-7. // Copyright (c) 2017年 沈阳东科云信软件有限公司. All rights reserved. // #import #import "BaseTableViewController.h" @interface BaseTableViewController () @end @implementation BaseTableViewController @synthesize hud; /** 初始化 @param style <#style description#> @return <#return value description#> */ - (id)initWithStyle:(UITableViewStyle)style { self = [super initWithStyle:style]; if (self) { // Custom initialization } return self; } /** 进度条 @param text <#text description#> */ - (void)showLoadingText:(NSString*)text { //如果设置此属性则当前的view置于后台 hud.dimBackground = YES; //设置对话框文字 hud.labelText = text; [hud show:YES]; } /** 弹出窗体对话框 @param text <#text description#> */ - (void)showAlertViewBackText:(NSString *)text{ } /** 加载进度条 */ - (void)showLoading { //如果设置此属性则当前的view置于后台 hud.dimBackground = YES; //设置对话框文字 hud.labelText = @"正在加载"; /* //显示对话框 [ hud showAnimated:YES whileExecutingBlock:^{ //对话框显示时需要执行的操作 } completionBlock:^{}]; */ [hud show:YES]; } /** 隐藏进度条 */ - (void) hideLoading { [hud hide:YES]; // [hud removeFromSuperview]; // self.hud = nil; } /** 弹出对话框 @param text <#text description#> */ - (void)showAlertViewText:(NSString *)text { // UIAlertController代替UIAlertView UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"提示" message:text preferredStyle:UIAlertControllerStyleAlert ]; [alert addAction:[UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action){ }]]; // 3.显示alertController:presentViewController [self presentViewController:alert animated:YES completion:nil]; } /** viewDidLoad */ - (void)viewDidLoad { [super viewDidLoad]; hud = [[MBProgressHUD alloc] initWithView:self.view] ; [self.view addSubview:hud]; } /** md5加密 @param str <#str description#> @return <#return value description#> */ - (NSString *) md5:(NSString *)str { const char *cStr = [str UTF8String]; unsigned char result[16]; CC_MD5( cStr, (CC_LONG)strlen(cStr), result ); return [NSString stringWithFormat:@"%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X", result[0], result[1], result[2], result[3], result[4], result[5], result[6], result[7], result[8], result[9], result[10], result[11], result[12], result[13], result[14], result[15] ]; } /** didReceiveMemoryWarning */ - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; } #pragma mark - Table view data source - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 0; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { // Return the number of rows in the section. return 0; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *cellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier forIndexPath:indexPath]; return cell; } @end