摘要:
链接地址:http://fei263.blog.163.com/blog/static/927937242009526112420548/- (NSString *)URLEncodedString:(NSString *)string{ NSString *result = (NSString *)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (CFStringRef)string,NULL,CFSTR("!*'();:@&=+$,/?%#[]"),kCFStringEncodin 阅读全文
摘要:
通常在IPhone里用网络访问会用到NSURLConnection来做url链接请求,下面简单介绍一下:1、同步请求 NSURL*url=[[NSURLalloc]initWithString:urlString]; NSMutableURLRequest *request=[[NSMutableURLRequestalloc]init]; NSError*err=nil; NSData*data=[NSURLConnectionsendSynchronousRequest:request returningResponse:nil error:&err]; if(data==nil) 阅读全文