This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jwaoeifjioewajfiowjaefiojwaiejf | |
wjfeaoijewaoifjowiajf | |
jwaeofijeoiwajfoiewajf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// SqlUtils.m | |
// UCBook | |
// | |
// Created by apple on 13-1-15. | |
// Copyright (c) 2013年 __MyCompanyName__. All rights reserved. | |
// | |
#import "SqlUtils.h" | |
#import "CommonUtils.h" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// StrikeLabel.h | |
// UCBook | |
// | |
// Created by apple on 13-1-23. | |
// Copyright (c) 2013年 __MyCompanyName__. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Toast.h | |
// UCBook | |
// | |
// Created by apple on 13-1-22. | |
// Copyright (c) 2013年 __MyCompanyName__. All rights reserved. | |
// | |
#define DEFAULT_DISPLAY_DURATION 2.0f |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//下载路径 https://github.com/samvermette/SVProgressHUD | |
// | |
// SVProgressHUDViewController.m | |
// SVProgressHUD | |
// | |
// Created by Sam Vermette on 27.03.11. | |
// Copyright 2011 Sam Vermette. All rights reserved. | |
// | |
//SVProgressHUD使用范例 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//1显示状态 | |
[SVProgressHUD showWithStatus:@"正在载入..."]; | |
//2从系统中获取一个并行队列 | |
dispatch_queue_t concurrentQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); | |
//3在后台线程创建图像选择器 | |
dispatch_async(concurrentQueue, ^{ | |
NSDictionary* data = [NSDictionary dictionaryWithContentsOfJSONURLString:kUrlOfBookComments]; | |
//4让主线程显示图像选择器 | |
dispatch_async(dispatch_get_main_queue(), ^{ | |
self.loadFooterView = [[LoadingMoreFooterView alloc]initWithFrame:CGRectZero]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// NSDictionary+JSONCategories.h | |
// ShopCloth | |
// | |
// Created by apple on 12-12-7. | |
// Copyright (c) 2012年 __MyCompanyName__. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
#import "AppDelegate.h" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//objective-c使用正则表达式验证邮箱 | |
+ (BOOL)isEmailAddress:(NSString*)email { | |
NSString *emailRegex = @"^\\w+((\\-\\w+)|(\\.\\w+))*@[A-Za-z0-9]+((\\.|\\-)[A-Za-z0-9]+)*.[A-Za-z0-9]+$"; | |
NSPredicate *emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", emailRegex]; | |
return [emailTest evaluateWithObject:email]; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//返回YYYY-MM-DD HH:MM:SS格式的当前时间 | |
+(NSString *)getCurrentTime{ | |
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; | |
[dateFormatter setDateFormat:@"YYYY-MM-dd HH:mm:ss"]; | |
return [dateFormatter stringFromDate:[NSDate date]]; | |
} | |
//如果信息发表在1小时之前显示分钟,一天之内的信息显示小时,10天之内按天显示,10天之外按所发表时间进行显示: | |
+ (NSString *)intervalSinceNow: (NSString *) theDate | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//控件下载地址:https://github.com/nicklockwood/AsyncImageView | |
//imageview本身有一张默认图片,远程图片请求完后,替换为远程图片 | |
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath | |
{ | |
static NSString *CellIdentifier = @"Cell"; | |
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; | |
if (cell == nil) |
OlderNewer