自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(56)
  • 资源 (1)
  • 收藏
  • 关注

原创 使用Ambari搭建集群遇到的问题

使用Ambari-2.4.1.0+HDP-2.5.0.0+HDP-UTILS-1.1.0.21+CentOS7搭建集群,每次卡在Confirm Hosts步骤,一直处于安装状态或失败,查看报错日志;ERROR 2018-05-18 14:13:02,566 NetUtil.py:88 - [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify fai...

2018-05-18 15:59:00 1130

转载 正确使用Block避免Cycle Retain和Crash

Block简介Block作为C语言的扩展,并不是高新技术,和其他语言的闭包或lambda表达式是一回事。需要注意的是由于Objective-C在iOS中不支持GC机制,使用Block必须自己管理内存,而内存管理正是使用Block坑最多的地方,错误的内存管理 要么导致return cycle内存泄漏要么内存被提前释放导致crash。 Block的使用很像函数指针,不过与函数最大的不同是:

2017-12-04 22:09:52 252

翻译 iOS 10-GCD的常用方式

直接上代码、#import "ViewController.h"@interface ViewController ()@end@implementation ViewController- (void)viewDidLoad {    [superviewDidLoad];   

2017-09-15 17:26:33 277

翻译 iOS 09-GCD多线程基础

一、任务与队列:1、执行任务的方式:用同步的方式执行任务dispatch_sync(dispatch_queue_t queue, dispatch_block_t block);queue: 队列block: 任务用异步的方式执行任务dispatch_async(dispatch_queue_t queue, dispatch_block_t block);同步和

2017-09-15 14:02:20 243

翻译 iOS 08-线程通信

#import "ViewController.h"#define IMAGE_URL @"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1505384144967&di=c99009f5c44b8bca603bd3aef02726d5&imgtype=0&src=http%3A%2F%2Ftup

2017-09-14 15:39:44 253

翻译 iOS 07-线程安全 同步锁

#import "ViewController.h"@interface ViewController ()@property (nonatomic,strong) NSThread *th1;@property (nonatomic,strong) NSThread *th2;@property (nonatomic,strong) NSThread

2017-09-14 15:38:32 247

翻译 iOS 06-多线程NSThread的使用

1、创建一个按钮- (IBAction)buttonClicked:(id)sender {   NSLog(@"main =%@",[NSThreadmainThread]);//    [self createThread1];    [selfcreateThread2];//    [self createThread3];  }

2017-09-14 15:33:24 210

转载 iOS UIAlertController代替代替UIAlertView与UIActionSheet

UIAlertController是用来代替之前我们使用的UIAlertView和UIActionSheet,这次的改进总体来讲,感觉思路更清晰简洁了,使用起来也是颇为顺手,下面不多说老样子上代码:#import "ViewController.h"    @interface ViewController ()    @end    @implementa

2017-09-13 14:48:06 875

转载 iOS UIViewController 和 xib 绑定 详解

原文地址:iOS UIViewController 和 xib 绑定 详解1> 创建 UIViewController,此处不选择 Alse create XIB file2> 创建 xib 文件3> 在 xib 中,点击 Placeholder -> File’s Owner在右边 Show the Identity inspector ,在

2017-09-12 16:19:54 823

原创 iOS 05-使用AFNetworking框架创建下载任务

一、使用Cocoapods库管理工具下载AFNetworking框架设置你的Cocoapods先要确保你已经安装了Cocoapods。为此,打开命令行程序,并输入。which pod  你将会看到类似这样的输出:/usr/bin/pod 如果命令行简单的返回提示,或显示pod not found,表示Cocoapods未安装在你的机器上使用一下命令完

2017-09-07 16:40:05 358

转载 iOS 04-NSSession类库之DataTask代理

@interface ViewController ()NSURLSessionDataDelegate>//创建数据容器,接收返回数据@property (nonatomic,strong) NSMutableData *data;@end-(void)touchesBegan:(NSSetUITouch *> *)touches withEvent:(UIEvent

2017-09-07 16:32:43 338

转载 iOS 03-NSURLSession类 GET与POST请求

//使用步骤:/* 1、创建NSURLSession的会话 2、根据会话创建Task 3、执行Task */不废话,直接上代码。-(void)touchesBegan:(NSSetUITouch *> *)touches withEvent:(UIEvent *)event{    [selfpost];}-(void)post

2017-09-07 16:24:24 288

转载 iOS 02-NSURLConnection的使用

NSURLConnection常用类:NSURL:用于设置请求地址NSURLRequest:用于封装一个请求,保=保存发给服务器的全部数据,包括NSURL对象,请求方式,请求头以及请求体等,默认请求方式是GETNSMutableURLRequest:是NSURLRequest的子类,常用方法有:设置请求超时等待时间:-(void)setTimeoutInterval

2017-09-06 17:51:29 229

转载 iOS 01 - HTTP协议的介绍

HTTP协议请求:发送HTTP请求的方法在HTTP/1.1协议中,定义了GET、POST、HEAD、PUT、DELETE、TARCE、CONNECT、PATCH这8种请求方法,不同方法对资源有不同的操作方式,最常用的是GET、和POSTGET和POST的选择1、如果要传送大量数据,例如文件上传,只能用POST请求2、GET的安

2017-09-06 17:50:04 306

原创 UI18-使用NSJSONSerialization方法解析JSON

使用系统自带的NSJSONSerialization解析JSON数据定义一下属性,我们将返回的JSOB数据一层一层转化@property (nonatomic,copy) NSArray *results;@property (nonatomic,copy) NSDictionary *location;@property (nonatomic,copy

2017-09-04 14:57:51 254

转载 UI17-xib文件自定义Cell

新手教程之使用Xib自定义UITableViewCell前言首先:什么是UITableView?看图其次:什么是cell?然后:为什么要自定cell,UITableView不是自带的有cell么?因为在日常开发中,系统自带的cell满足不了客户和开发人员的需求(并且每个cell中的内容\大小\样式相同),我们就需要自定义cell来实现更加优化

2017-08-25 16:41:10 319

翻译 Ui16-触摸事件与UIResponder

//一根手指或多跟手指触摸屏幕。-(void)touchesBegan:(NSSetUITouch *> *)touches withEvent:(UIEvent *)event;//一根手指或多根手指在屏幕上移动(随着手指的移动,相关的对象会持续发送该消息)-(void)touchesMoved:(NSSetUITouch *> *)touches withEvent

2017-08-25 16:39:30 210

转载 UI15-UIImageView响应点击事件

有时候会遇到点击一张图片,然后让这张图片触发一个事件,或者是跳转视图,想到的第一个方法就是用UIButton,将Button的背景图片属性设置为该图片,效果达到了,但不是最好的方法,直接触发方法定义Image的对象;UIImageView *imgView =[[UIImageViewalloc] initWithFrame:CGRectMake(0,0,320,100

2017-08-25 16:30:08 231

原创 UI14-UINavigationController和UITabBarController一起使用

开发中常遇到UINavigationController和UITabBarController一起使用的场景在APPDelegate.m中编写代码:- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

2017-08-23 10:17:59 449

翻译 UI13-UITabBarController底部导航视图

分别创建PhotoAlbumViewController、ShootViewController、MyViewController三个视图控制器器在AppDelegate中编写代码:- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)laun

2017-08-23 09:27:32 297

翻译 UI12-分段视图

//先生成存放标题的数据 NSArray *array = [NSArray arrayWithObjects:@"家具",@"灯饰",@"建材",@"装饰", nil]; //初始化UISegmentedControl UISegmentedControl *segment = [[UISegmentedControl alloc]initWithItems:array

2017-08-22 17:57:06 376

转载 UIXX-UITableView用法及进阶

基本 API 解释以及用法数据源 UITableViewDataSource代理 UITableViewDelegateUITableViewCell一些常用操作UITableView 进阶性能优化优雅的使用 UITableView 之链式编程UITableView 相关的开源库MJRefresh 上拉下拉刷新组件UITableView+FDTemplateLayo

2017-08-16 09:57:15 632

翻译 UIXX-UITableView制作简单表格

一、创建一个工程,在ViewController.h文件中编写代码:#import //添加两个协议一个是表格视图数据源协议,一个是表格视图代理协议@interface ViewController :UIViewControllerUITableViewDataSource,UITableViewDelegate>@end二、在Vi

2017-08-15 22:50:12 950

转载 UI11-事件传递

创建MainViewController继承自UIViewController,创建SubView、MyWindow 继承自UIView一、在APPDelegate.m中编写代码:#import "AppDelegate.h"#import "MyWindow.h"#import "MainViewController.h"@interface

2017-08-09 16:10:07 199

转载 UI12-导航栏视图控制器的使用

新建工程,创建三个类继承自UIViewController,分别是FirstViewController、SecondViewController 、ThirdViewController一、编写APPDelegate.m文件中代码:#import "AppDelegate.h"#import "FirstViewController.h"@interf

2017-08-09 15:55:24 263

转载 UI10-UIView视图添加阴影效果

1.    给图片添加阴影效果:- (void)viewDidLoad {    [super viewDidLoad];    UIImage *img = [UIImage imageNamed:@"pic"];    UIImageView *imgView = [[UIImageView alloc] initWithImage:img];    imgView.fra

2017-08-08 09:39:13 292

转载 UI09-UIView视图添加圆角效果

1、        创建工程,编写代码:- (void)viewDidLoad {    [super viewDidLoad];    //读取一张图片    UIImage *img = [UIImage imageNamed:@"pic"];   //将该图片添加到图像视图    UIImageView *imgView = [[UIImageView alloc]

2017-08-08 09:37:30 198

转载 UI08-UIView视图添加边框效果

1、        创建一个工程,编写ViewController.h中的代码:- (void)viewDidLoad {    [super viewDidLoad];   //UIImage是一个用来加载和绘制图像的类,将一张图片添加到资源文件夹,改名为pic    UIImage *uiimage = [UIImage imageNamed:@"pic"];    //加

2017-08-08 09:35:58 258

转载 UI07 -UIView视图的基本操作

1、        创建一个工程,在ViewController.h中添加代码:@implementation ViewController- (void)viewDidLoad {    [super viewDidLoad];   //初始化一个矩形变量作为视图显示区域    CGRect rect = CGRectMake(30, 50, 200, 200);

2017-08-08 09:31:44 280

转载 UI06-UIView视图层次关系

1.    创建一个工程,在ViewController.h中添加代码:@implementation ViewController- (void)viewDidLoad {    [super viewDidLoad];   //创建三个UIView视图 第一个视图是第二个视图的父视图 第二视图是第三个视图的父视图    UIView *view1 = [[UIView al

2017-08-08 09:26:06 430

转载 UI05-UIView视图的创建

一、     创建一个工程,在ViewController.h中编写代码:二、      - (void)viewDidLoad {    [super viewDidLoad];   //创建一个视图坐标为(30,50)大小为(200,200)    CGRect rect1 = CGRectMake(30, 50, 200, 200);    UIView *view1

2017-08-08 09:24:32 234

转载 UI04-UIImageView图片组件

创建一个工程,在AppDelegate.m中编写代码:#import "AppDelegate.h"#import "ViewController.h"@interface AppDelegate ()@end@implementation AppDelegate- (BOOL)ap

2017-08-02 17:22:39 297

转载 UI03-Button的使用

创建一个工程,删除ViewController .h和.m文件,创建一个类MainViewController 继承自UIViewController编写AppDelegate.m文件 导入#import"MainViewController.h" 编写代码:- (BOOL)application:(UIApplication *)application didFini

2017-08-02 15:20:40 215

原创 Swift 学习笔记01-字符串及运算符

isEmpty 判断字符串是否为空,返回布尔值hasPrefix(prefix:String)检查字符串是否拥有特定前缀hasSuffix(suffix:String)检查字符串是否拥有特定后缀Int(String)转换字符串数字为整型。let myString: String = "123"let myInt: Int? = Int(myStr

2017-08-01 15:41:26 270

转载 OC中的冒泡排序法

#import     int main(int argc, const charchar * argv[]) {      @autoreleasepool {                        /*  冒泡排序法的基本思想:(以升序为例)含有n个元素的数组原则上要进行n-1次排序。对于每一躺的排序,从第一个数开始,依次比较前一个数与后一个数的大小。 

2017-07-27 18:03:40 515

翻译 OC语言学习23-Block在类中的应用

创建Mother类和OldWoman类:Mother.h中的代码:#import @interface Mother : NSObject@property(nonatomic,copy)NSString *name;//block作为属性运用@property(nonatomic,copy)void(^actionB

2017-07-25 17:33:14 217

翻译 OC语言学习22-Block基本语法

创建工程,在main.h中编写代码:#import //自定义C语言函数void test(){    printf("%s\n",__func__);}int main(int argc,const char * argv[]) {    @autoreleasepool {        //函数指

2017-07-25 16:46:03 244

翻译 OC语言学习21-分类应用

创建一个分类:在原有基础上实现一个翻转字符串的功能:New File  -> Objective-C File 创建一个NSString 类 名为Helper的分类文件NSString + Helper.h文件代码#import @interface NSString (Helper)//翻转字符串-(NSString

2017-07-25 11:32:41 178

翻译 UI02-视图创建

1、打开Xcode创建一个工程,为了纯代码实现,删除多余文件。2、创建一个MainViewController类继承UIViewController3、在AppDelegate.m中编写代码:- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary

2017-07-21 17:16:10 340

转载 UI01-第一个UI程序

打开Xcode创建一个ios工程:以纯代码编写一个视图,删除下面文件在AppDelegate.m文件中编写代码如下:- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

2017-07-21 15:32:52 425

Xshell-6.0.0107

Xshell 是一个强大的安全终端模拟软件,它支持SSH1, SSH2, 以及Microsoft Windows 平台的TELNET 协议。Xshell 通过互联网到远程主机的安全连接以及它创新性的设计和特色帮助用户在复杂的网络环境中享受他们的工作

2019-03-23

空空如也

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

TA关注的人

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