上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 20 下一页

一段异步操作的代码(清理缓存)

摘要: dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ NSString *cachPath = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) objectAtIndex:0]; NSArray *files = [[NSFileManager defaultMan... 阅读全文
posted @ 2013-12-05 11:16 jack_yan 阅读(408) 评论(0) 推荐(0)

计算两点距离 ios

摘要: //计算两点距离-(float)distanceBetweenTwoPoint:(CGPoint)point1 point2:(CGPoint)point2{ return sqrtf(powf(point1.x - point2.x, 2) + powf(point1.y - point2.y, 2));} 阅读全文
posted @ 2013-11-26 10:12 jack_yan 阅读(650) 评论(0) 推荐(0)

适配ios7

摘要: if ([self respondsToSelector:@selector(edgesForExtendedLayout)]) { self.edgesForExtendedLayout = UIRectEdgeNone; self.extendedLayoutIncludesOpaqueBars = NO; self.modalPresentationCapturesStatusBarAppearance = NO; } 阅读全文
posted @ 2013-11-25 13:40 jack_yan 阅读(129) 评论(0) 推荐(0)

UITextView ios7

摘要: UITextView *textView2 = [[UITextView alloc]initWithFrame:CGRectMake(0, textView1.frame.size.height + 60, 495,20)]; textView2.backgroundColor = [UIColor clearColor]; textView2.textColor = [UIColor blackColor]; textView2.font= [UIFont systemFontOfSize:19]; [scrollView addSu... 阅读全文
posted @ 2013-11-22 21:09 jack_yan 阅读(244) 评论(0) 推荐(0)

页面切换效果

摘要: TwoDView *twoD =[[TwoDView alloc]init]; CATransition *animation = [CATransition animation]; [animation setDuration:0.4]; [animation setType: kCATransitionPush]; [animation setSubtype: kCATransitionFromLeft]; [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMed... 阅读全文
posted @ 2013-11-22 03:23 jack_yan 阅读(163) 评论(0) 推荐(0)

NSString去掉火车和空格

摘要: // backString = [backString stringByReplacingOccurrencesOfString:@"\r" withString:@""];// backString = [backString stringByReplacingOccurrencesOfString:@"\n" withString:@""]; 阅读全文
posted @ 2013-11-07 09:43 jack_yan 阅读(122) 评论(0) 推荐(0)

NSURLConnection获取数据

摘要: - (void)loadDataFromUrl{ NSURL* url = [NSURL URLWithString:@"http://m.weather.com.cn/data/101190408.html"]; NSMutableURLRequest * urlRequest=[NSMutableURLRequest requestWithURL:url]; NSURLConnection* urlConn = [[NSURLConnection alloc] initWithRequest:urlRequest delegate:self]; [urlConn s.. 阅读全文
posted @ 2013-11-01 16:19 jack_yan 阅读(292) 评论(0) 推荐(0)

base64编码问题 需要对每个参数URL编码

摘要: - (NSString *)encodeToPercentEscapeString: (NSString *) input{ // Encode all the reserved characters, per RFC 3986 // () NSString *outputStr = (NSString *) CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (CFStringRef)input, ... 阅读全文
posted @ 2013-10-30 16:06 jack_yan 阅读(711) 评论(0) 推荐(0)

iOS常用的开源类库

摘要: 开发几个常用的开源类库及下载地址: 引用 1.json json编码解码 2.GTMBase64 base64编码解码 3.TouchXML xml解析 4.SFHFKeychainUtils 安全保存用户密码到keychain中 5.MBProgressHUD 很棒的一个加载等待特效框架 6.ASIHTTPRequest http等相关协议封装 7.EGORefreshTableHeaderView 下拉刷新代码 8.AsyncImageView 异步加载图片并缓存代码 9.类似setting的竖立也分栏程序扫描wifi信息:http://code.google.com/p/uwecaugm 阅读全文
posted @ 2013-10-30 14:50 jack_yan 阅读(191) 评论(0) 推荐(0)

传送表单

摘要: //参数1名字=参数1数据&参数2名字=参数2数据&参数3名字=参数3数据&... // NSString *post = [NSString stringWithFormat:@"active=login&u_name=a&u_pwd=000618"]; //将NSSrring格式的参数转换格式为NSData,POST提交必须用NSData数据。 NSData *postData = [postString dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:YES 阅读全文
posted @ 2013-10-25 16:08 jack_yan 阅读(222) 评论(0) 推荐(0)
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 20 下一页