自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(43)
  • 收藏
  • 关注

转载 NSString 字符串操作

//一、NSString/*----------------创建字符串的方法----------------*/ //1、创建常量字符串。NSString *astring = @"This is a String!";//2、创建空字符串,给予赋值。NSString *astring = [[NSString alloc] init];astri...

2016-03-09 16:47:00 101

转载 NSArray 数组操作

/*---------------------------创建数组------------------------------*///NSArray *array = [[NSArray alloc] initWithObjects:@["One",@"Two",@"Three",@"Four",nil];self.dataArray = array;[array...

2016-03-09 16:46:00 100

转载 MVC设计模式

MVC模式(Model-View-Controller)是软件工程中的一种软件架构模式,把软件系统分为三个基本部分:模型(Model)、视图(View)和控制器(Controller)。MVC模式最早由Trygve Reenskaug在1978年提出[1],是施乐帕罗奥多研究中心(Xerox PARC)在20世纪80年代为程序语言Smalltalk发明的一种软件设计模式。MVC模式...

2016-02-22 11:15:00 215

转载 iOS开发_统计xcode代码行数

如果要统计ios开发代码,包括头文件的,终端命令进入项目目录下,命令如下find.-name"*.m"-or-name"*.h"-or-name"*.xib"-or-name"*.c"|xargswc-l列出每个文件的行数find.-name"*.m"-or-name"*.h"-or-name"*...

2016-02-22 11:14:00 70

转载 iOS 状态栏设置

iOS 7 以前:状态栏由 UIApplication 管理  1.隐藏状态栏 :[[UIApplication sharedApplication] setStatusBarHidden:YES];  2.设置状态栏样式 :[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightCon...

2016-01-08 17:32:00 66

转载 AVCaptureDevice的几个属性

AVCaptureDevice.h,主要用来获取iphone一些关于相机设备的属性。AVCaptureDevice.h,必须要引入AVFoundation.framework包。 1 //1. 前置和后置摄像头 2 3 enum { 4 5 AVCaptureDevicePositionBack = 1, 6 7 ...

2016-01-08 11:26:00 165

转载 iOS 获取系统目录

//获取根目录 NSString *homePath = NSHomeDirectory(); NSLog(@"Home目录:%@",homePath); //获取Documents文件夹目录,第一个参数是说明获取Doucments文件夹目录,第二个参数说明是在当前应用沙盒中获取,所有应用沙盒目录组...

2016-01-08 11:26:00 93

转载 iOS 将系统文字设置为中文

在.info文件中添加 Localization native development region 键值 string Value值:en转载于:https://www.cnblogs.com/Merrill/p/5112586.html

2016-01-08 11:24:00 213

转载 IOS创建单例的两种方法

1.0 苹果官方写法:1 static AccountManager *DefaultManager = nil; 2 3 + (AccountManager *)defaultManager { 4 if (!DefaultManager) DefaultManager = [[self allocWithZone:NULL] init]; ...

2016-01-08 11:23:00 67

转载 UITableView 隐藏多余的分割线

1 //隐藏多余的分割线2 - (void)setExtraCellLineHidden: (UITableView *)tableView3 {4 UIView *view =[ [UIView alloc]init];5 view.backgroundColor = [UIColor clearColor];6 [tableView s...

2016-01-08 11:22:00 69

转载 FMDatabase 数据库的使用

创建,插入,更新和删除:使用executeUpdate方法,而查询则用executeQuery1.实例化FMDatabase//paths: ios下Document路径,Document为ios中可读写的文件夹NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDom...

2016-01-08 11:22:00 924

转载 去掉UItableview headerview黏性

1 //去掉UItableview headerview黏性 2 - (void)scrollViewDidScroll:(UIScrollView *)scrollView { 3 if (scrollView == self.tableView) 4 { 5 CGFloat sectionHeaderHeight = 30; ...

2016-01-08 11:21:00 57

转载 NSURLSessionUploadTask 上传

1 -(void)uploadPhotoImageWithUrl:(NSString*)url 2 userIMID:(NSString*)userIMID 3 imageData:(NSData*)imageData 4 imageName:...

2016-01-08 11:18:00 110

转载 iOS 键盘弹出遮挡输入框

1 #pragma mark 键盘弹出遮挡输入框 2 3 //开始编辑输入框的时候,软键盘出现,执行此事件 4 -(void)textFieldDidBeginEditing:(UITextField *)textField 5 { 6 CGRect frame = textField.frame; 7 int offset = frame...

2016-01-08 11:17:00 72

转载 NSURLSessionDownloadTask 下载文件

1 -(void)RequestdataUI:(NSString*)ImageURL 2 imageName:(NSString*)imageName{ 3 4 NSURL *url = [NSURL URLWithString:ImageURL]; 5 NSMutableURLRequest *request = [...

2016-01-08 11:17:00 291

转载 iOS8毛玻璃效果

1 UIBlurEffect*blueEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];2 UIVisualEffectView* visualView=[[UIVisualEffectView alloc]initWithEffect:blueEffect];3 visualView...

2016-01-08 11:16:00 60

转载 KVC/KVO

1、KVCKVC(KeyValueCoding) “键-值-编码”是一种可以直接通过字符串的名字(key)来访问类实例变量的机制,是通过setter、getter方法访问。属性的访问和设置KVC可以用来访问和设置实例变量的值。key是属性名称设置方式:[self setValue:aName forKey:@"name"]等同于 self.name = aName;...

2016-01-08 11:15:00 65

转载 UIScrollView基本使用

1 - (void)viewDidLoad 2 { 3 [super viewDidLoad]; 4 5 scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, 320, 460)]; 6 scrollView.backgroundColo...

2016-01-08 11:14:00 75

转载 在ios8上 [TableView setSeparatorInset:UIEdgeInsetsMake(0,0,0,0)];不起作用 经过测试加入下面方法 在ios7 8上都可以正常工作...

1 -(void)viewDidLayoutSubviews 2 { 3 if ([self.tableView respondsToSelector:@selector(setSeparatorInset:)]) { 4 [self.tableView setSeparatorInset:UIEdgeInsetsMake(0,0,0,0)];...

2016-01-08 11:12:00 104

转载 NSDictionary json格式字符串转字典,字典转json格式字符串

1 + (NSDictionary *)dictionaryWithJsonString:(NSString *)jsonString { 2 3 if (jsonString == nil) { 4 5 return nil; 6 7 } 8 9 NSData *jsonData = [jsonString dataUsingEncodin...

2016-01-08 11:11:00 109

转载 OC 字符串

1 //一、NSString 2 3 /*----------------创建字符串的方法----------------*/ 4 5 //1、创建常量字符串。 6 NSString *astring = @"This is a String!"; 7 8 //2、创建空字符串,给予赋值。 9 NSString *astri...

2016-01-08 11:10:00 60

转载 OC 数组

1 /*---------------------------创建数组------------------------------*/ 2 //NSArray *array = [[NSArray alloc] initWithObjects: 3 @"One",@"Two",@"Three",@"Four",nil]; 4 5 self.dataArr...

2016-01-08 11:09:00 84

转载 C 各种数据类型介绍

1.各种数据类型介绍: 基本数据类型最主要的特点是,其值不可以再分解为其它类型。也就是说,基本数据类型是自我说明的。1.1整型  整形包括短整型、整形和长整形。1.1.1短整形  short a=1;1.1.2整形  一般占4个字节(32位),最高位代表符号,0表示正数,1表示负数,取值范围是-2147483648~2147483647,在内存中的存储顺序...

2016-01-08 11:07:00 230

转载 C 运算符与表达式

  运算(操作)是对数据的加工。最基本的运算形式常常可以用一些简洁的符号来记忆,这些符号称为运算符或操作符。被运算的对象-数据称为运算量或操作数。表达式描述了对哪些数据、以什么顺序以及施加什么样的操作。运算量可以是常量,也可以是变量,还可以是函数。  C语言中提供了丰富的运算符,能够构成多种表达式,它把许多基本操作都作为运算符处理。例如,C语言把赋值符作为赋值运算符。  学...

2016-01-08 11:06:00 177

转载 C语言预处理指令

C程序的源代码中可包括各种编译指令,这些指令称为预处理命令。虽然它们实际上不是C语言的一部分,但却扩展了C程序设计的环境。本节将介绍如何应用预处理程序和注释简化程序开发过程,并提高程序的可读性。ANSI标准定义的C语言预处理程序包括下列命令:#define,#error,#include,#if,#else,#elif,#endif,#ifdef,#ifndef,#undef,#...

2016-01-08 11:06:00 117

转载 C 内存管理

对于一个C语言程序而言,内存空间主要由五个部分组成代码段(.text)、数据段(.data)、BSS段(.bss),堆和栈组成,其中代码段,数据段和BSS段是编译的时候由编译器分配的,而堆和栈是程序运行的时候由系统分配的。布局如下在上图中,由编译器分配的地址空间都是在连接的时候分配的,而运行时分配的空间是在程序运行时由系统分配的BSS段:BSS段(bss...

2016-01-08 11:05:00 48

转载 iOS 网络请求——get请求

1 -(void)getRequest{ 2 NSString *urlString = [NSString stringWithFormat:@"http://f1.netgears.cn:8081/cloudadmin_new/interface/commonQueryDataObject.action?opercode=yfc_intf&operPassw...

2016-01-08 11:04:00 60

转载 iOS 网络请求——post请求

1 -(void)postRequest{ 2 3 NSString *urlString = [NSString stringWithFormat:@"http://f1.netgears.cn:8081/cloudadmin_new/interface/commonQueryDataObject.action"]; 4 5 NSURL...

2016-01-08 11:03:00 101

转载 iOS 任意类型数据转换字符串

1 //转换数据类型:2 3 NSError *parseError = nil;4 5 NSData *jsonData = [NSJSONSerialization dataWithJSONObject:responseObject options:NSJSONWritingPrettyPrinted error:&parseError];6...

2016-01-08 11:02:00 570

转载 iOS修改截取图片不规范问题

1 +(UIImage *) imageCompressForWidth:(UIImage *)sourceImage targetWidth:(CGFloat)defineWidth{ 2 UIImage *newImage = nil; 3 CGSize imageSize = sourceImage.size; 4 CGFloat widt...

2016-01-08 11:01:00 47

转载 iOS通知NSNotificationCenter

NSNotificationCenter消息通信作用:NSNotificationCenter是专门供程序中不同类间的消息通信而设置的.注册通知:即要在什么地方接受消息[[NSNotificationCenterdefaultCenter]addObserver:selfselector:@selector(mytest:)name:@" ...

2016-01-08 10:59:00 99

转载 iOS坐标转换

// 将像素point由point所在视图转换到目标视图view中,返回在目标视图view中的像素值- (CGPoint)convertPoint:(CGPoint)point toView:(UIView *)view;// 将像素point从view中转换到当前视图中,返回在当前视图中的像素值- (CGPoint)convertPoint:(CGPoint)point...

2016-01-08 10:59:00 46

转载 UIPasteboard 粘贴板

1 // 复制文字到粘贴板 2 UIPasteboard *pasteboard = [UIPasteboard generalPasteboard]; 3 pasteboard.string = self.label.text;转载于:https://www.cnblogs.com/Merrill/p/5112431.html

2016-01-08 10:57:00 128

转载 iOS根据2个经纬度计算距离

1 #pragma mark - calculate distance 根据2个经纬度计算距离 2 3 #define PI 3.14159265358979323 4 +(double) CalculationDistanceOther_Lon1:(double)lon1 Other_Lat1:(double)lat1 self_Lon2:(double)lon2...

2016-01-08 10:56:00 130

转载 iOS计算文本高度

NSDictionary *attribute = @{NSFontAttributeName: UIFont(14)}; CGRect labelRect = [string boundingRectWithSize:CGSizeMake(200,2000) options:(NSStringDrawingUsesLineFragmentOrigin|NSSt...

2016-01-08 10:54:00 83

转载 NavigationBar--修改返回按钮的标题

UIBarButtonItem *backItem = [[[UIBarButtonItem alloc] init] autorelease]; backItem.title = @"返回"; self.navigationItem.backBarButtonItem = backItem;转载于:https://www.cnblogs.com/Mer...

2016-01-08 10:52:00 85

转载 获取iOS设备属性

通过使用UIDevice:[[UIDevice currentDevice] systemName];[[UIDevice currentDevice] systemVersion];//os version[[UIDevice currentDevice] uniqueIdentifier];[[UIDevice currentDevice] model];...

2016-01-08 10:45:00 74

转载 iOS调用系统声音与振动

如何调用系统声音?【iphone 调用系统铃声与震动功能】首先要在工程里加入Audio Toolbox framework这个库,然后在需要调用的文件里#import <AudioToolbox/AudioToolbox.h>最后在需要播放提示音的地方编写如下代码:AudioServicesPlaySystemSound(1000);//新邮件消息提示AudioSer...

2016-01-08 10:45:00 153

转载 获取iOS应用的版本号和app名称

NSDictionary*infoDict=[[NSBundlemainBundle]infoDictionary];NSString*versionNum=[infoDictobjectForKey:@"CFBundleVersion"];//版本名称NSString*appName=[infoDictobjectForKey:@"CFBundle...

2016-01-08 10:44:00 74

转载 iOS 打开系统设置

NSURL*url=[NSURL URLWithString:@"prefs:root=WIFI"];[[UIApplication sharedApplication] openURL:url];And[font=]About — prefs:root=General&path=AboutAccessibility — prefs:root=Gener...

2016-01-08 10:42:00 61

空空如也

空空如也

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

TA关注的人

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