网络
文章平均质量分 73
_tian_qian
这个作者很懒,什么都没留下…
展开
-
iOS网络图片保存到本地
说明//共享数据 —-> 特殊的PC (本地服务器,远程服务器)//C/S//IP 10.20.157.135 —> 域名//14.215.177.38 –>//区分资源 —> URL//ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=4271053251,2424464488&fm=116&gp=0.jpg//URL —> //C/S原创 2016-11-05 16:22:57 · 893 阅读 · 0 评论 -
AVAudioPlayer实现音乐播放+歌词与播放进度同步
说明:.lrc 歌词文件 + .mp3 音频文件Demo实现功能: 1.音乐播放/暂停 2.歌曲选择 3.播放进度,声音控制 4.歌词和播放进度同步ViewControllerimport AVFoundation/AVFoundation.h import “CYParserLrc.h”@interface ViewController () UITableViewDataSource,原创 2016-11-07 15:43:11 · 2212 阅读 · 0 评论 -
AVPlayer实现视频播放
Demo实现功能: 1.视频的播放/暂停 2.播放进度前进后退ViewController import AVFoundation/AVFoundation.h import “TQPlayView.h”@interface ViewController ()@property (nonatomic,strong) AVPlayer *player;@property (nonatomic,原创 2016-11-07 16:06:29 · 4511 阅读 · 0 评论 -
MediaPlayer视频播放
iOS视频播放//#import MediaPlayer/MediaPlayer.h - (IBAction)play:(id)sender {//NSString *path = [[NSBundle mainBundle] pathForResource:@"3" ofType:@"mp4"];NSString *path = @"http://127.0.0.1/net/Movie/梁静茹.原创 2016-11-07 16:13:50 · 496 阅读 · 0 评论 -
CLGeocoder地理编码器 正向编码 + 反向编码
CLGeocoder//正向地理编码-(void)geocoder { CLGeocoder *coder = [[CLGeocoder alloc] init];[coder geocodeAddressString:@"深圳大学" completionHandler:^(NSArray *placemarks, NSError * _Nullable error) { CLP原创 2016-11-08 10:19:57 · 337 阅读 · 0 评论 -
MKMapView 地图 + 混合地图 + 卫星地图
MKMapView//CLLocationManager —> 模拟定位//地理编码 //通过地名 —> 正向地理编码 //通过经纬度 —> 反向地理编码import “ViewController.h” import MapKit/MapKit.h@interface ViewController () @property (nonatomic,strong) MKMapView *m原创 2016-11-08 10:25:59 · 938 阅读 · 0 评论 -
MKMapView地理位置查询
import MapKit/MapKit.h@interface ViewController () UISearchBarDelegate@property (nonatomic,strong) MKMapView *mapView;@property (nonatomic,strong) UISearchBar *searchBar;@end@implementation ViewControl原创 2016-11-08 10:32:21 · 797 阅读 · 0 评论 -
GCD
GCD Demo(void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib.//同步 和 异步 //具备开辟线程的能力//GCD 栈 //队列 和 任务//A B//串行队列 //dispatch_queue_c原创 2016-11-08 10:49:00 · 407 阅读 · 0 评论 -
NSOperation
NSOperationViewController(void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib.//队列 NSOperationQueue //任务 NSOperation // NSInvoc原创 2016-11-08 11:10:19 · 147 阅读 · 0 评论 -
SDWebImageDemo
SDWebImage//—> imageView //离线 —-> imageURL //sd —> URL —> URL本地的图片 —> 下载图片 —> Data —> URL//urlstr // —-> 文件夹 —> 加密//urlstr//md5 32位 加密 (小写)//- (NSString *)getMd5_32Bit { // const char *c原创 2016-11-08 11:14:35 · 159 阅读 · 0 评论 -
NSThread
同步Demo//NSURlSe(void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. NSLog(@”%@”,[NSThread currentThread]);//创建线程 NSThread *thread = [[N原创 2016-11-08 10:42:09 · 169 阅读 · 0 评论 -
CoreData
CoreData的使用Demo1//框架头文件 import CoreData/CoreData.h//1.操作数据库 —> NSManageObjectContext //2.添加数据库 —> NSPersistentStoreCoordinator //3.关联模型@interface ViewController ()@end@implementation ViewController原创 2016-11-07 15:21:17 · 154 阅读 · 0 评论 -
SQL数据库SQLite
SQL常用语句//数组//写文件 data string //NSU //NSF //100000000 —> 99//数据库 写文件 —> dict key value –> 哈希算法//基本单位 表(字段 字段的类型)//出现一个区分唯一的数据字段 主键//二进制位 //整形 integer //浮点型 double real //字符串 varc原创 2016-11-07 15:01:05 · 239 阅读 · 0 评论 -
UIWebView
UIWebView常用方法//json —> html字符串 - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib.//http://www.baidu.com ---> 数据 htmlUIWe原创 2016-11-05 16:56:58 · 142 阅读 · 0 评论 -
网络请求之-AFNetworking
Demo//json //KVC -(void)manager { //[NSJSONSerialization JSONObjectWithData:<#(nonnull NSData )#> options:<#(NSJSONReadingOptions)#> error:<#(NSError _Nullable __autoreleasing * _Nullable)#>]原创 2016-11-07 09:46:59 · 151 阅读 · 0 评论 -
JSONModel
Controller(void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib.//KVC if 0//JSONModelNSDictionary *dict = @{@"name":@"zhangsan",@"age":@原创 2016-11-07 10:03:04 · 123 阅读 · 0 评论 -
网络请求之-NSURLSeesion
NSURLSeesion的简单应用//NSURLSession 管理任务 task//NSURLSessionDataTask 普通下载的任务//NSURLSessionDownloadTask 下载任务 如果想支持后台下载,必须使用当前任务 //NSURLSessionUploadTask 上传任务//NSURLSessionConfiguration 会话配置的对象 //defaul原创 2016-11-07 10:14:17 · 133 阅读 · 0 评论 -
网络请求之-NSURLConnection
NSURLConnection//http://www.baidu.com//1.创建URL//http://127.0.0.1/net/%E4%B8%AD%E5%9B%BD.png//url中出现中文 必须先经过转码NSString *urlStr = @"http://www.baidu.com";//UIWebView//xcode7 之后的方法 ---> UTF-8urlStr =原创 2016-11-05 16:47:03 · 207 阅读 · 0 评论 -
网络请求方式 POST + GET
说明//URL —> 参数//URL 长度 1024 //http:// …. ?username=?&userpasswd=? //照片//http –> get –> 参数放到URL后面 //post –> 参数放到请求体//用户名 和 密码 —> 发给服务器 —> data//POST —> json —> data —> NSJSON//#define kT原创 2016-11-07 10:33:03 · 311 阅读 · 0 评论 -
3种网络请求 NSURLConnection + NSURLSeesion + AFNetworking
//Connection请求网络数据(系统) -(void)NSURLConnectionPOST{ NSURL *url = [NSURL URLWithString:@”http://api.douban.com/v2/movie/top250“];NSMutableURLRequest *req = [NSMutableURLRequest requestWithURL:url];原创 2016-11-07 11:09:12 · 226 阅读 · 0 评论 -
iOS实现断点续传
controller//写文件的文件句柄 @property (nonatomic,strong) NSFileHandle *writeHandle;//当前下载总的字节数 @property (nonatomic) long long currentDownloadByte;//总文件大小 @property (nonatomic) CGFloat fileSize;@end@implem原创 2016-11-07 14:22:29 · 295 阅读 · 0 评论 -
XML解析
//xml json//GDataXMLNode –> xml 100k XPath//sax (NSXMLParser) 节省内存 不能读取指定的数据 //dom (GDataXMLNode) 读取指定的数据 浪费内存//GDataXMLNode —> 配置工程//1.依赖一个库文件 libxml2 .a //2.添加库文件的路径 //3.GDataXM原创 2016-11-07 14:42:01 · 161 阅读 · 0 评论 -
iOS FMDataBase 实现离线缓存
controller//徒步去旅行@interface ViewController ()@property (nonatomic,strong) NSMutableArray *array;@end@implementation ViewController-(void)initData { //1.先读本地数据 self.array = [[TQDataBase share原创 2016-11-07 14:48:15 · 355 阅读 · 0 评论 -
WKWebView OC与js的交互
DemoViewController import WebKit/WebKit.h@interface ViewController () WKNavigationDelegate,WKUIDelegate,WKScriptMessageHandler@property (nonatomic,strong) WKWebView *webView;@property (nonatomic,stron原创 2016-11-08 16:18:13 · 3988 阅读 · 0 评论