自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Clement_Gu的博客

致力于纯代码的开发

  • 博客(23)
  • 收藏
  • 关注

转载 http Connect

我们平时使用HTTP协议无非就是GET、POST这些方法,但是HTTP的内容远不止那些。今天就来说说HTTP代理使用的CONNECT。这个不是在网页开发上用的,如果没兴趣就跳过吧。  APACHE只是作为网页的服务器被使用的,不会支持这个方法。如果要使用它必须在服务器上安装相应的软件。这样的软件很多,百度一下HTTP代理服务器就可以找到一大把。  CONNECT这个方法的作用就是把服务器作

2016-03-31 09:42:49 798

原创 cocoapods 的安装步骤 及使用安装第三方框架

一.cocoapods 主要作用是帮助下载并安装第三方框架,并自动产生依赖 使第三方框架不需要调试 可以直接用二.安装步骤1.确认当前账户是管理员身份2.移除原先的源gem sources --remove https://rubygems.org/3. 添加国内的源gem sources -a https://ruby.taobao.org/注意是 h

2016-03-28 17:17:40 246

原创 gitBox 出现Couldn’t communicate with a helper application.

我的错误是因为 太乱了里面的项目太多 导致错乱了 我用的是gitosc解决方法:xcrun git config --global user.email 自己的gitosc邮箱号xcrun git config --global user.name "自己的gitosc名字"然后在工程文件中commit项目 系统会提示你 输入账号 (邮箱号) 密码(gitosc密码

2016-03-28 17:03:57 833

原创 新弹出框UIAlert 的简单用法

//创建信息窗体初始化    UIAlertController *alert = [UIAlertControlleralertControllerWithTitle:@"信息错误"message:@"用户名或密码不正确"preferredStyle:UIAlertControllerStyleAlert];    //创建执行操作 title是显示的按键信息

2016-03-28 16:19:15 421

原创 将data转换成string

NSData *data = [NSData data];//将NSData转换成NSString    NSString *resultStr = [[NSStringalloc]initWithData:dataencoding:NSUTF8StringEncoding];

2016-03-25 09:48:08 853

原创 viewWithTag简单用法 寻找视图中特定的子视图

1.原理在创建控件时候设置特定的tag ,viewWithTag 会从self.view 逐级往下搜索找到对应的tag 并返回控件对应的类型 ,搜索不到返回nil。创建viewfor (int i = 0; i {//row and column//行int row = i/3;//列int colume = i%3;//创建子视图UIIma

2016-03-22 20:49:30 1052

原创 计算程序运行的某一段时间

//创建时间一    NSDate  *date1 = [NSDatedate];    /*代码段*/    //创建时间二    NSDate  *date2 = [NSDatedate];    //计算两个时间的间隔    NSTimeInterval interval = [date2 timeIntervalSinceDa

2016-03-22 19:23:21 274

原创 This application is modifying the autolayout engine from a background thread 原因

This application is modifying the autolayout engine from a background thread, which can lead to engine corruption and weird crashes.  This will cause an exception in a future release.1.翻译下就是 应用程序的

2016-03-22 17:01:09 517

转载 子线程能否更新UI

原因有2个:1、在子线程中是不能进行UI 更新的,而可以更新的结果只是一个幻像:因为子线程代码执行完毕了,又自动进入到了主线程,执行了子线程中的UI更新的函数栈,这中间的时间非常的短,就让大家误以为分线程可以更新UI。如果子线程一直在运行,则子线程中的UI更新的函数栈 主线程无法获知,即无法更新 2、只有极少数的UI能,因为开辟线程时会获取当前环境,如点击某个按钮,这个按钮响应的方

2016-03-22 16:42:50 560

原创 App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure.

pp Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file. 原因及解决方法1.原因是xcode的安全协议不支持h

2016-03-22 16:25:30 452

原创 frame 和 bounds 的关系

//bounds 是对象自身的起点(默认 0 ,0 )和宽高//frame 是对象在父对象中的 位置 起点宽和高  //每个对象的bounds 都是 其子对象的 frame 坐标参照系 ,由下面代码 可以看出 对象的bounds 的(0,0)点为其子对象的frame的坐标原点,如果 bounds 不是(0,0)起点 那么创建子对象的frame起点

2016-03-21 21:33:08 214

原创 Prefix Header 的设置

1.Prefix Header 是将定义的define 导入系统框架 从而所有.m文件无需import 可以直接调用2.不宜过大会增加系统buid时间3.创建新的头文件 在other里面 后缀为 pch4.点击工程buildsetting 里面点击 all 搜索Prefix Header5.在Prefix Header 后半格双击输入  $(SRCROOT)/工程名/文件名(例:p

2016-03-21 20:18:41 3005

原创 得到系统的时间 并转化成NSString NSDate

//获取时间    NSDate *date = [[NSDate alloc]init];    NSDateFormatter *formatter = [[NSDateFormatter alloc]init];    [formatter setDateFormat:@"HH:mm:ss"];//    [formatter setDateFormat:@"

2016-03-19 14:38:36 267

原创 改变iOS 启动页面 lauchscreen

更改启动页面 要先把原来的默认启动页面给取消掉点击蓝色的工程文件 general里面 把launch images source 改成brand assets  没有的话要新建把launch screen file 内容删掉然后点击LaunchScreen.StoryBoard 如下图 把use as launch Screen 选项的勾点掉 最后在Assets.xcasset

2016-03-19 14:10:38 659

原创 plist 文件的增删改查 例子

////  ViewController.m//  数据的增删改查////  Created by Clement_Gu on 16/3/14.//  Copyright © 2016年小白. All rights reserved.//#import "ViewController.h"@interfac

2016-03-15 22:57:54 744

原创 点击背景页面取消键盘

//在页面加载前-(void)loadView{    //将ViewContrller中的View变为UIContrl的对象    UIControl *control = [[UIControl alloc]initWithFrame:[UIScreen mainScreen].bounds];    [self setView:control];

2016-03-14 21:30:51 268

原创 获得沙盒路径NSHomeDirectory

//沙盒路径    NSString *paths = NSHomeDirectory();//沙盒路径 然后进入Documents    NSString *path = [NSHomeDirectory()stringByAppendingPathComponent:@"Documents"];    //再从Documents里面创建plist

2016-03-14 18:15:22 347

原创 替换NSString字符串某段字符的内容

//定义一个字符串        NSString *str = @"1234567891011";        //设定要替换的范围        NSRange range = NSMakeRange(7,2);        //进行替换        str = [str stringByReplacingCharactersInRange

2016-03-11 10:15:21 551

原创 UIPopover 的简单用法

popover是弹出窗口并不在页面具体存在popover可以弹出UIview UITableView 等控制器所控制的页面所显示的内容//下面是一个纯代码的演示 其中UINavigation 已经定义 但没有展示出来#import "DetailViewController.h"#import "SubTableViewController.h"@int

2016-03-10 22:45:09 335

原创 -[__NSArrayI removeObjectAtIndex:]: unrecognized selector sent to instance 0x7fcc60626ca0'原因及解决

//报错信息Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayI removeObjectAtIndex:]: unrecognized selector sent to instance 0x7fcc60626ca0'//原因1.把不可变数组NSArray

2016-03-10 12:54:11 2603

原创 Delegate 用于简单的页面传值方法

//有页面A和页面B//页面A跳转到B // 页面B 返回 并传值给A//A页面跳转B 不传值仅跳转A页面 代码//.h#import @interface ViewControllerA : UIViewController@end//.m#import "ViewControll

2016-03-09 22:31:58 303

原创 'UICollectionView must be initialized with a non-nil layout parameter' 报错原因及解决

'UICollectionView must be initialized with a non-nil layout parameter'这个报错是因为 CollectionView在创建的时候或者在跳转页面的时候没有指定其UICollectionViewFlowLayout  // UICollectionViewFlowLayout *flow = [[UICollect

2016-03-09 22:29:05 3612

原创 iOS UI 页面的跳转方法

1.是通过拉控件页面A的UIButton 拉到页面B2.是通过指定连线(segue)的名字跳转//[self performSegueWithIdentifier:@"segue name" sender:nil   ];//这种法类似于拖控件但是要在连线上 标上Identify3.通过Storyboard创建一个对象弹出UIStoryboard *storyboard = [

2016-03-09 22:13:32 266

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除