| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163 |
- //
- // BaseTableViewController.m
- // IBOSS
- //
- // Created by iHope on 14-7-7.
- // Copyright (c) 2017年 沈阳东科云信软件有限公司. All rights reserved.
- //
- #import <Foundation/Foundation.h>
- #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
|