上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 36 下一页
摘要: 一:上传表单 --> Send this file: 二:上传处理文件php 0) { $error = "file upload error"; array_push($result,0,$error,$_FILES); } else { if (file_exists("upload/" . $_FILES["file"]["name"])) { echo json_encode($_FILES["file"]["name"] . " already... 阅读全文
posted @ 2013-12-25 21:08 cocoajin 阅读(2606) 评论(0) 推荐(0)
摘要: 一:iOS6.0及以后:下拉刷新控件UIRefreshControlTableView属性:refreshControl二:使用 1 - (void)colseTheTB 2 { 3 [self dismissViewControllerAnimated:YES completion:nil]; 4 } 5 6 - (void)viewDidLoad 7 { 8 [super viewDidLoad]; 9 10 self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithBarBut... 阅读全文
posted @ 2013-12-25 14:33 cocoajin 阅读(671) 评论(0) 推荐(0)
摘要: 思路:用花生壳做动态域名解析用wamp server 在本机上做一个 php web server; 这样就可以让一台内网电脑做一个测试用的服务器;一:wamp server php环境绑定域名安装wamp server开启虚拟主机功能---点击wamp server图标--apache---httpd.conf---找到httpd-vhosts.conf 把# Include conf/extra/httpd-vhosts.conf前面的 #号去掉;配置虚拟主机:打开 wamp/bin/apache/apache2.4.5/conf/extra/httpd-vhosts.conf找到 ... 阅读全文
posted @ 2013-12-20 23:18 cocoajin 阅读(773) 评论(0) 推荐(0)
摘要: 一:本示例代码包括:文件下载,写入指定目录下载进度,回调Progress;断点续传,下载暂停,继续操作;二:本项目 适用于 AFNetworking 1.x 版本 1 #pragma mark 断点续传下载; 2 3 //断点下载续传--需要服务器端的支持,本次测试为下载百度音乐,此接口,会在第二次暂停,继续下载时,出404错误; 4 5 //进度 6 UIProgressView *downProgressView = [[UIProgressView alloc]initWithProgressViewStyle:UIProgressViewS... 阅读全文
posted @ 2013-12-20 20:50 cocoajin 阅读(4341) 评论(0) 推荐(0)
摘要: 一:SSL Ping Mode使用SSL来进行网络通信成为了很多mobile app的默认选择。最近一些文章发现:一些app并没有采用“额外的措施”来保证窃听不可以发生:这个“额外的步骤“就是SSL Pinning。iOS上SSL连接默认是这样的,client 和server建立一个连接,server返回其 SSL证书。如果这个证书是被OS信任的证书机构签发,那么这个连接就正常进行下去。随后交换session key进行通信。这个关键点就在于“信任“。如果攻击者进行中间人攻击,mobile device很可能也会信任攻击者的证书。一般来说,攻击者不太可能有受信任的证书,所以通常情况下这个问题也 阅读全文
posted @ 2013-12-19 16:29 cocoajin 阅读(2081) 评论(0) 推荐(0)
摘要: 主要是使用3个方法rangeOfString 是否包含hasPrefix 是否在前缀包含hasSuffix 是否在末尾包含如代码: //判断字符是否包含某字符串; NSString *staA = @"hello,JiNan,jkk"; NSRange theRange =[@"jkk" rangeOfString:staA]; NSLog(@"%d %d",theRange.location,theRange.length); NSRange range2 = [staA rangeOfString:@"jkk" 阅读全文
posted @ 2013-12-18 16:46 cocoajin 阅读(7144) 评论(0) 推荐(0)
摘要: 在此有一个webView默认是打开 百度的页面;设置代理,并在代理中处理- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType 1 - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNaviga 阅读全文
posted @ 2013-12-18 16:25 cocoajin 阅读(1164) 评论(0) 推荐(0)
摘要: iOS 使用 NSFileManager对沙盒里面的文件和目录,增加,修改,删除操作;- (void)viewDidLoad{ [super viewDidLoad]; self.title = @"NSFileManager"; NSFileManager *defauleManager = [NSFileManager defaultManager]; NSString *tempPath = NSTemporaryDirectory(); NSLog(@"%@",tempPath); NSString *thePath = nil; ... 阅读全文
posted @ 2013-12-18 10:27 cocoajin 阅读(9855) 评论(0) 推荐(0)
摘要: 一:NSOperation 两个子类+重写main方法NSInvocationOperationNSBlockOperation 有个类方法 BlockOprationWith:还有就是自己个子类重写main方法,把任务写在main方法里面二:NSOperationQueue 线程管理器类方法 mainQueue类方法 currentQueuealloc init 新Queue三:使用代码:(ARC环境)#pragma mark NSOperationQueue - (void)doBtnFoure{ //一:主线程测试; //NSOperationQueue *mainQueue... 阅读全文
posted @ 2013-12-17 15:05 cocoajin 阅读(1137) 评论(0) 推荐(0)
摘要: UITextField,UITextView字数限制主要是使用他们的两个代理方法//标题限制在 30个字以内 - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{ if (range.location>=30) { UIAlertView *alertNums = [[UIAlertView alloc]initWithTitle:@"输入提示" m... 阅读全文
posted @ 2013-12-16 13:53 cocoajin 阅读(485) 评论(0) 推荐(0)
上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 36 下一页