- 博客(18)
- 收藏
- 关注
原创 NSURLSession
基础知识 //NSURLSession做网络请求 //相关的类 //1.NSURL: 请求地址 //2.NSURLRequest:请求对象(和NSURLConnection使用的请求对象一样的) //3.NSURLSession:发送请求,并且获取从服务器返回的数据 //4.NSURLSessionConfiguration:会话模式 //a.defaultSessionCon
2016-05-31 17:41:06 253
原创 NSURLconnection-Post
-(void)viewDidLoad{ //1.创建请求路径url NSURL* url = [NSURL URLWithString:@”https://comic.idreamcastle.com/api/register/?access_token=ecpzcknd9wv92hwoafgbj0r28w24h9xl“]; //2.创建请求对象 //想要发送POST
2016-05-31 17:31:54 408
原创 iOS-URLconnection
基础概念 //1.NSURLConnection的作用就是简化HTTP请求的过程,而且可以收集服务器返回的信息 //2.NSURLConnection使用步奏: //a.创建请求的URL对象 //设置请求路径 //b.根据URL创建请求对象 //c.发送请求(通过NSURLConnection去发送请求)//通过协议代理获取 -(void)test2{ //1.设置请求路
2016-05-30 21:07:15 248
原创 多线程-NSOperation
基本概念 //操作:(任务)想要执行的操作,想要做的事情 //队列:专门用来存放任务的//使用步骤 //1.创建一个队列对象 //2.创建一个任务对象 //3.将任务对象放到队列中(系统会自动将任务从队列中取出来,并且开启新的线程去执行任务)=====基本使用===== //NSInvocationOperation创建任务 -(void)test1{ //1.创建队列
2016-05-30 20:42:29 210
原创 多线程-GCD
//1.两个核心概念 //任务:想要执行操作(想要做的事情) //队列:用来存放任务的容器//2.使用GCD的步骤 //a.先创建一个队列 //b.确定任务 //c.将任务放到队列中(GCD会自动将任务从队列中取出,放到对应线程中执行)//3.四个术语 /*******队列属性*********/ //同步:在当前线程中执行任务 //异步:在另外一个线程中执行任务 /***队列中的
2016-05-30 20:17:23 191
原创 NSthread-多线程通信
//1.创建一个子线程,用来获取网络图片 [NSThread detachNewThreadSelector:@selector(downloadImage:) toTarget:self withObject: @”http://pic36.nipic.com/20131128/11748057_141932278338_2.jpg“]; //下载图片 -(void)down
2016-05-29 23:07:01 258
原创 多线程-NSthread
多线程创建: 创建1: //1.创建一个NSThread对象,NSThread就代表线程类 //参数1:响应消息的对象 //参数2:需要在子线程中执行的方法 //参数3:在子线程中执行的方法的实参 NSThread *thread = [[NSThread alloc] initWithTarget:self selector:@selector(longTi
2016-05-29 22:51:59 229
原创 UITextView
1、实例化 UITextView *view = [[UITextView alloc] initWithFrame:CGRectMake(40, 100, 240, 150)]; 2、字体颜色 view.textColor = [UIColor cyanColor]; 3、字体大小 view.font = [UIFont boldSystemFontOfSize:14];
2016-05-12 21:55:34 235
原创 PageControl
1、实例化 _pageControl = [[UIPageControl alloc] initWithFrame:CGRectMake(30, HEIGHT-30, WIDTH-30, 30)]; 2、设置圆点个数 _pageControl.numberOfPages = 9; 3、设置默认选中 _pageControl.currentPage = 0; 4、设置选中
2016-05-12 20:33:12 210
原创 UIscrollView
1、关闭自动布局,会影响导航条和navgationBar self.automaticallyAdjustsScrollViewInsets = NO; 2、实例化 UIScrollView* ScrollView = [[UIScrollView alloc] initWithFrame:[UIScreen mainScreen].bounds]; 3、设置内容物大小
2016-05-12 20:24:53 204
原创 UIGesture
UITapGestureRecognizer 点击手势 1、实例化 UITapGestureRecognizer* tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(imageViewTap 2、将手势添加到视图 [imageView addGestureRecognizer:tap
2016-05-11 18:49:15 291
原创 UITabBar
UITabBarController->UIViewController 1、实例化 UITabBarController* tabarVc =[[UITabBarController alloc] init]; 2、类型 barStyle tabarVc.tabBar.barStyle = UIBarStyleDefault; 3、tabbar背景色 barTintColor tab
2016-05-10 21:10:50 322
原创 UIControl
UISwitch->UIControl->UIView 1、实例化 UISwitch* switch1 = [[UISwitch alloc] initWithFrame:CGRectMake(20, 50, 1000, 2000)]; 2、添加 [self.view addSubview:switch1]; 3、开关状态 switch1.on = YES; 4
2016-05-09 21:15:15 198
原创 UIAlertController
1、创建 UIAlertController* alertVc = [UIAlertController alertControllerWithTitle:@”温馨提示” message:@”你的手机没有网络” preferredStyle:UIAlertControllerStyleActionSheet]; 2、显示 [self presentViewController:ale
2016-05-09 20:31:57 221
原创 AlertView&ActionSheet
AlertView 1、创建 UIAlertView* alertView = [[UIAlertView alloc] initWithTitle:@”什么鬼” message:@”有毒” delegate:self cancelButtonTitle:@”确定” otherButtonTitles:nil, nil]; 2、显示 [alertView show]; 3、设置类型
2016-05-09 20:20:51 221
原创 iOS学习UI之UINavigationController
UINavigationbar 1、获取导航栏 UINavigationBar* bar = self.navigationController.navigationBar; 2、导航栏样式 barStyle self.navigationController.navigationBar.barStyle = UIBarStyleDefault; 3、设置导航栏的颜
2016-05-09 19:49:45 205
原创 iOS学习UI之UITextfield
UITextField->UIControl->UIView 常用属性 1.图片对象转化为颜色对象 textField.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@”DOVE 1”]]; 2.borderStyle 边框样式 textField.borderStyle = UITextBor
2016-05-06 19:39:55 1089
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人