摘要:
//图片压缩 阅读全文
摘要:
1 +(NSString*)getTimeFromTimeStamp:(NSString*)dateStamp 2 { 3 4 NSDate *confromTimesp = [NSDate dateWithTimeIntervalSince1970:dateStamp.floatValue]; 5 NSDateFormatter *formatter = [[NSD... 阅读全文
摘要:
1 +(NSString*)getTimeStamp:(NSDate*)dateNow 2 { 3 4 NSTimeInterval time = [dateNow timeIntervalSince1970]*1000;//NSTimeInterval本身是个秒级别的double类型数值,小数点后面即毫秒数,*1000.0f即可得到毫秒级别的时间差 5 long long d... 阅读全文
摘要:
1 #import "HXCActivity.h" 2 #define Activity_WIDTH 40.f 3 #define Activity_HEIGHT 40.f 4 5 static UIWebView *_gifView; 6 static UIWindow *window; 7 static UIView *showview; 8 @interface HXCA... 阅读全文
摘要:
@是一种简便写法 1. 6不是一个对象,加个@6会转化成对象,等同于[NSNumber numberWithInt:5], 2.@[@"1",@"2",@"3"],代表数组 3.@{@"key":@"1"},代表字典 字典的另一种写法:(装逼的写法,post请求的时候来使用) 阅读全文
摘要:
1 -(void)scrollViewWillBeginDragging:(UIScrollView*)scrollView{ 2 lastContentOffset = scrollView.contentOffset.y; 3 } 4 -( void )scrollViewDidScroll:( UIScrollView *)scrollView { 5 ... 阅读全文
摘要:
#define RGBCOLOR(r,g,b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1] #define RGBACOLOR(r,g,b,a) [UIColor colorWithRed:(r)/2 阅读全文
摘要:
1 //MD5加密 2 + (NSString *)md5HexDigest:(NSString*)password 3 { 4 const char *original_str = [password UTF8String]; 5 unsigned char result[CC_MD5_DIGEST_LENGTH]; 6 CC_MD5(original_str, ... 阅读全文
摘要:
1 //sha1加密方式 2 +(NSString *)sha1:(NSString *)input 3 { 4 //const char *cstr = [input cStringUsingEncoding:NSUTF8StringEncoding]; 5 //NSData *data = [NSData dataWithBytes:cstr length:inpu... 阅读全文
摘要:
1 //判断网络是否连接 2 + (BOOL) connectedToNetwork 3 { 4 //创建零地址,0.0.0.0的地址表示查询本机的网络连接状态 5 struct sockaddr_in zeroAddress; //struct用来向方法中传递复杂的参数(把参数当作对象,这样便于扩展) 6 bzero(&zeroAddr... 阅读全文