- 博客(95)
- 资源 (1)
- 收藏
- 关注
转载 CocoaPods 安装和使用
转自:http://blog.csdn.net/showhilllee/article/details/38398119 一、概要 iOS开发时,项目中会引用许多第三方库,CocoaPods(https://github.com/CocoaPods/CocoaPods)可以用来方便的统一管理这些第三方库。 二、安装 由于网上的教程基本都大同小异,但细
2016-06-05 19:20:09 355
原创 对一个类里面的数组添加观察时注意问题
root是一个类,arr是root里面的一个数组 //能触发观测者调用的方法 [[roo mutableArrayValueForKey:@"arr"] addObject:@"dddd"]; [[roo mutableArrayValueForKey:@"arr"] addObject:@"aaa"]; //不会触发观测者调用的方法 [roo.arr
2016-06-05 12:29:31 369
转载 UIColor+Hex
#import @interface UIColor (Hex) + (UIColor *)colorWithHex:(long)hexColor; + (UIColor *)colorWithHex:(long)hexColor alpha:(float)opacity; @end #import "UIColor+Hex.h"
2016-05-19 13:58:54 456
原创 跳转到系统设置
跳转到系统设置 if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]]) [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicat
2016-05-09 16:21:21 310
原创 处理闪退日志
导出crash log,并通过crash log与dsym文件跟踪crash信息 1.如何导出crash report 或者叫crash log 途径有 a) 通过Xcode->Windows->Devices 导出手机log b)针对没有Xcode的普通用户,可以通过iTunes同步,导出crash log 设备与电脑上的iTunes Store同
2016-04-28 15:43:02 1254
原创 UIBezierPath 贝尔曲线
画实线@implementation UIView (Drawing) -(CAShapeLayer *)drawLineFromPoint:(CGPoint)p1 toPoint:(CGPoint)p2 width:(CGFloat)width color:(UIColor *)color { UIBezierPath *path = [UIBezierPath bezierPath]
2016-04-15 14:57:42 1286
原创 resizableImageWithCapInsets 图片拉伸
UIImageView *imgView = [[UIImageView alloc] initWithFrame:CGRectMake(50, 100, 300, 300)]; CGSize size = [UIImage imageNamed:@"test"].size; NSLog(@"---- width:%.0f - height:%.0f",size.width,siz
2016-04-15 09:54:43 557
转载 UIImagePickerController 介绍
iOS 获取图片有三种方法: 1. 直接调用摄像头拍照 2. 从相册中选择 3. 从图库中选择 UIImagePickerController 是系统提供的用来获取图片和视频的接口; 用UIImagePickerController 类来获取图片视频,大体分为以下几个步骤: 1. 初始化UIImagePickerController 类; 2. 设置UII
2016-03-24 10:15:49 314
原创 UIImagePickerController 相册取照片
//UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init]; imagePicker.delegate = self; imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;//样式 imagePic
2016-03-23 18:31:19 272
原创 NSMutableAttributedString
NSMutableAttributedString *attribute = [[NSMutableAttributedString alloc] initWithString:@"12345" attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:30]}]; [attribute appendAttributed
2016-03-16 18:48:59 627
原创 NSMutableAttributedString
NSMutableAttributedString *attribute = [[NSMutableAttributedString alloc] initWithString:@"12345" attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:30]}]; [attribute appendAttributed
2016-03-16 18:43:47 261
原创 返回机型
+ (NSString*)deviceString { // 需要#import "sys/utsname.h" struct utsname systemInfo; uname(&systemInfo); NSString *deviceString = [NSString stringWithCString:systemInfo.machine enc
2015-12-16 17:53:49 246
转载 NSJSONSerialization用法
ios5中apple增加了解析JSON的api——NSJSONSerialization。网上已经有人做过测试,NSJSONSerialization在效率上完胜SBJSON、TouchJSON、YAJL、JSONKit、NextiveJson。详情见这里。既然apple为我们提供了这么良好的工具,我们没理由不用吧。 NSJSONSerialization提供了将JSON数据转换为Fou
2015-11-19 13:48:01 504
原创 ios 网络连接判断
-(NetworkStatus)currentReachabilityStatus { if([self isReachable]) { if([self isReachableViaWiFi]) { return ReachableViaWiFi; } return Reachable
2015-11-03 11:41:55 321
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人