- 博客(114)
- 收藏
- 关注
转载 pod install 错误 - incompatible character encodings: UTF-8 and ASCII-8BIT
pod install[!] Invalid `Podfile` file: incompatible character encodings: UTF-8 and ASCII-8BIT. Updating CocoaPods might fix the issue.1、Podfile 文件中存在 单引号错误 正确的' 转载于:https://www...
2014-08-06 12:10:00
536
转载 NSDictionary 的有序性 (by the key in some rule)
NSDictionary 的有序性: (by the key in some rule)NSDictionary*myDictionary =[NSDictionary dictionaryWithObjectsAndKeys:@"o1",@"k1",@"o6",@"k4",@"o2",@"k2",@"o3",@"k3",@"o5",@"k5", nil];NSInteger cou...
2014-04-10 10:34:00
311
转载 CGContext 的一些工具方法
/* *设置虚线 *param context CGContext *param context CGContext *param lineDashLengths 如: const CGFloat lineDashLengths[2] = {2., 50. }; 2 是没接虚线的长度2 和间隔50 *returns */void setXuXian...
2013-11-20 17:05:00
167
转载 NSString Byte NSData 字节(字符)字符串
NSUTF8StringEncoding 3个字节(字符)一个中文字符一个字节一个英文字符转载于:https://www.cnblogs.com/zander/p/3387856.html
2013-10-25 14:34:00
103
转载 CG
//设置线的宽度CGContextSetLineWidth(ctx, 12);//设置线的连接处 (拐点)CGContextSetLineJoin(ctx,kCGLineJoinRound)/* Line join styles. */ enum CGLineJoin { kCGLineJoinMiter, k...
2013-07-25 17:18:00
96
转载 UIView的响应链
父视图 和子视图的关联只有当父视图 userInteractionEnabled=YES; 是其子视图才可响应userInteractionEnabled=NO代表不接受响应UIView的默认值时YES UIview的子类 的默认值要根据具体的api。转载于:https://www.cnblogs.com/zander/p/3208917.html...
2013-07-23 17:00:00
94
转载 拼音 名字 排序 a-z的比较 ( sortUsingComparator )
NSMutableArray * array = [NSMutableArrayarrayWithObjects:@"ad",@"az",@"ac",@"ab",@"aa", nil]; DLog("ar :: %@",array); [array sortUsingComparator:^NSComparisonResult(id obj1, id obj2) {...
2013-06-16 17:44:00
276
转载 Core data 数据同步
我有点想吐槽用了大半年的coredata 今天才知道 core data 真正意义上的 数据同步是怎么一回事 。。。。。。。。还是买本书好好看看 。。。最便宜的 200多 、、、、、、神呀转载于:https://www.cnblogs.com/zander/archive/2013/04/19/3030993.html...
2013-04-19 16:22:00
91
转载 ios adi ADBannerView 无法修改 宽度
ios adi ADBannerView 无法修改 宽度转载于:https://www.cnblogs.com/zander/archive/2013/03/25/2980910.html
2013-03-25 15:52:00
67
转载 ios 判断横竖屏的方法
或者在有statusbar情况下UIInterfaceOrientationIsLandscape([[UIApplication sharedApplication] statusBarOrientation])UIInterfaceOrientationIsPortrait([[UIApplication sharedApplication] statusBarOrientation...
2013-03-12 14:03:00
237
转载 nil NULL [NSNULL null]
NSLog(@"%@",[NSStringstringWithFormat:@"%@",nil]); NSArray* array = [NSArrayarrayWithObjects:[NSNullnull],[NSStringstringWithFormat:@"%@",nil], nil]; NSObject* o1 = [array objectAtInde...
2013-03-08 10:59:00
80
转载 stringByTrimmingCharactersInSet 取出string 前后空格
- (NSString *)stringByTrimmingCharactersInSet:(NSCharacterSet *)set//Use whitespaceCharacterSet or whitespaceAndNewlineCharacterSet to remove whitespace around strings.转载于:https://www.cnblogs...
2013-02-25 16:50:00
100
转载 UITableView隐藏多余的分割线
UITableView隐藏多余的分割线转自http://blog.sina.com.cn/s/blog_6f453dd601018o1z.html看了好多东西,觉得隐藏多余的分割线,基本两个各思路,一个是通过代码,一个是代码配合背景图片。第一种比较常见,在网上到处都是,我这也是抄别人的。主要就是说自己定义一个view,弄成透...
2013-01-25 11:15:00
63
转载 模拟器 真机 测试 内存消耗 资源对比
//模拟器上 (快10 倍)2013-02-09 17:44:46.091 Fuel Monitor[10185:15203] ------------------2013-02-09 17:44:46.092 Fuel Monitor[10185:15203] date::2013-02-09 09:44:45 +00002013-02-09 17:44:46.092 ...
2013-01-24 17:56:00
197
转载 core data 手动修改 .xcodatamodeld 文件 和 po 生成的 模型类 注意事项
1. .h 文件中1) @class 引入 NSSet* 类型的外键也要引入2) 添加对应的属性@property (nonatomic, retain) NSString * 外键属性名;2. . m文件中1)#import "外键的className.h"2)添加对应的@dynamic外键属性名;转载于:https://www.cnblogs.co...
2013-01-19 10:41:00
78
转载 项目架构简述
1.需求主线现弄清晰 (便于数据库的创建,确保正确的外键关系)转载于:https://www.cnblogs.com/zander/archive/2013/01/19/2867282.html
2013-01-19 10:12:00
113
转载 如何定义一个应用之间调用的ios 本地URL
1.如何定义一个应用之间调用的ios 本地URL一下博客详解http://www.cnblogs.com/supercheng/archive/2012/11/05/AppInvoke.html2. 检测 定义的URL是否可以连接NSLog(@"isOK:%d",[[UIApplication sharedApplication] canOpenURL:[NSUR...
2012-12-04 14:31:00
74
转载 控制一个cell不可被移动到另外一个section中
- (NSIndexPath *) tableView:(UITableView *)tableView targetIndexPathForMoveFromRowAtIndexPath:(NSIndexPath *)sourceIndexPath toProposedIndexPath:(NSIndexPath *)proposedDestinationIndexPath {ret...
2012-11-30 17:20:00
120
转载 解决UItableView cell的间隔线 separatorStyle ( plain group 两种类型)
一 . Plain类型的:做法cell 的backgroupView 是设置的 57 pix,在此基础上 在方法willDisplayCell 中cell.backgroundView添加一个高为55Pix的view 作为背景这样就有了 2pix的 cell 下边框了-(CGFloat)tableView:(UITableView *)tableView heig...
2012-10-10 15:42:00
211
转载 webview 显示pdf
UIWebView*webView =[[UIWebView alloc] initWithFrame:CGRectMake(10,10,200,200)];NSURL *targetURL =[NSURL URLWithString:@"http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIW...
2012-09-25 10:03:00
115
转载 instance method '-addMask' not found (return type defaults to 'id')
摘的instance method '-addMask' not found (return type defaults to 'id')今天下午修复了一个警告这很明显是由于没有包含头文件造成的警告dan但明明在ZZ.m中包含了YY.h文件但发现是在YY.m 中包含了XX.h 文件而YY.h 中只有@class XX ;声明所以只包含YY.h...
2012-09-22 15:18:00
114
转载 ios 6 的 小改变
1.代码加载nib文件 nib文件区分大小写ResumeDetail_ipad* resumeDetail_ipad = [[[ResumeDetail_ipadalloc] initWithNibName:@"ResumeDetail_ipad"bundle:nil] autorelease];加载 nib 文件 的时候 出现的ResumeDetail_ipad 区分大...
2012-09-21 09:46:00
72
转载 关于tableView group样式 时设置 cell的width 宽度
关于tableView group样式 时设置 cell的width 宽度table frame 的 宽度 - 35 ooo转载于:https://www.cnblogs.com/zander/archive/2012/09/18/2691130.html
2012-09-18 18:26:00
183
转载 UISwitch的用法总结开关用法
1.UISwitch的初始化UISwitch *switchView = [[UISwitch alloc] initWithFrame:CGRectMake(4.0f, 16.0f, 100.0f, 28.0f)];2.设置UISwitch的初始化状态switchView.on = YES;//设置初始为ON的一边3....
2012-09-17 14:13:00
95
转载 模式视图 键盘消失 问题
if(starttextfield==nil){ starttextfield=[[UITextFieldalloc]initWithFrame:CGRectMake(0, 0, 10, 10)]; } starttextfield.backgroundColor=[UIColo...
2012-09-14 10:17:00
65
转载 (可转屏的)横竖屏 屏模式下的UIDatePicker (摘)
(可转屏的)横竖屏 屏模式下的UIDatePicker (摘)http://www.miiceic.org.cn/ruangong/software_6260.html转载于:https://www.cnblogs.com/zander/archive/2012/09/11/2680454.html
2012-09-11 16:47:00
70
转载 判断 iPhone 虚拟键盘是否打开的代码 (转)
判断iPhone虚拟键盘是否打开的代码http://blog.sina.com.cn/s/blog_70ba46340100oteq.htmlCocoaChina 会员“qqn_pipi”分享的判断 iPhone 虚拟键盘是否打开的代码,原理很简单:看当前的窗口是否存在一个 responder,从而判别 iPhone 的键盘是否打开了。BOOL TTI...
2012-09-10 17:03:00
76
转载 iPhone和ipad键盘高度及键盘响应事件 摘
iPhone和ipad键盘高度及键盘响应事件http://blog.youkuaiyun.com/benbenxiongyuan/article/details/7892019IPAD键盘高度:portrait 264landscape 352.iPhone键盘高度:Portrait 216Landscape 140背景: ios...
2012-09-10 16:10:00
104
转载 UITextField 控件详解 我见过的史上最牛x的
UITextField-IOS开发摘自:http://www.myeducs.cn/sys/IOS/UITextFieldIOS-kaifa.htm//初始化textfield并设置位置及大小 UITextField *text = [[UITextField alloc]initWithFrame:CGRectMake(20, 20, 130, 30)];...
2012-09-08 17:18:00
820
转载 判断横竖屏的方法
1.CGRect aRect = [[UIScreenmainScreen] applicationFrame]; if (aRect.size.height>768) { NSLog(@"height ::%f",aRect.size.height); NSLog(@"竖屏幕....."); ...
2012-09-06 14:27:00
112
转载 webView 中显示 html 的那些事
在webView 中显示 html 首先是html 在各个浏览器上的兼容问题 其次还要考虑 html 脚本在webView的实际显示效果 (其中有部分还要考虑ios 系统版本问题)1. html 脚本中  显示空格 效果 (由于在html 中是不读取我们 敲击键盘的空格的) 在4.0  + 半角空格或者全角空格(就是英文下的空格,全角空格就...
2012-09-05 09:50:00
93
转载 ios 代码生成绘制 pdf 小技巧
绘制的整个过程 UIGraphicsBeginPDFPage();//创建一个空白页 CGContextSetTextMatrix(pdfContext, flip);//为上下文设置仿射矩阵 CGContextBeginPath(pdfContext); // 打开上下文 开始绘制CGFloatheight=50;NSS...
2012-09-04 10:43:00
112
转载 MapKit学习笔记 摘
MapKit学习笔记1、概述插入MapView,设置Delegate(一般为Controller),Annotati*****记录兴趣位置点(AnnotationView用来显示兴趣位置点),annotation是可选的,选中的annotation会显示callout,用来显示信息。2、设置地图显示类型:mapView.mapType = MKMapTypeStan...
2012-09-03 18:42:00
99
转载 objective-c 中判断字符串 是否为空
NSManagedObject* object=[self.listDataobjectAtIndex:i]; NSString* orderby = [object valueForKey:@"orderby"]; NSLog(@"orderby::%d",orderby.length==0);//可以 NSLog(@"...
2012-09-03 11:50:00
319
转载 Date 类型的操作--格式化并转化成字符串
NSDate *da=[thisdata valueForKey:@"date"]; NSDateFormatter *dateformatter=[[[NSDateFormatteralloc]init]autorelease]; [dateformatter setDateFormat:@"MMMM dd, yyyy"]; N...
2012-09-03 10:08:00
157
转载 ios开发之使用CoreData的轻量级自动数据迁
使用IOS的CoreData进行存储很方便,CoreData已经帮我们做了很多基础的工作,一般情况下没必要自己操作数据库了。在开发中修改了实体模型,可能会遇到schema incompatibility的错误,这是因为修改了数据结构,要进行数据迁移。其实很多简单的情况,不用这么麻烦,Coredata提供了轻量级的自动数据迁移,比如以下三个情况会自动进行:1.简单的增加一个字段2.把一个必...
2012-08-30 09:24:00
94
转载 button的两种初始化
button的初始化有两种一种是动态创建UIButton *button1 = [UIButton alloc]initWithFrame:CGRectMake(0, 0, 80, 50)];接下来设置button属性另一种是静态创建UIButton *button2 = [UIButton buttonWithType:UIButtonTypeRoundedRect];设置butt...
2012-08-21 16:51:00
620
转载 [NSBundle mainBundle] 详解
不错的博文NSBundle介绍http://blog.sina.com.cn/s/blog_8c87ba3b0100t89v.html大家可以看一下NSLog(@"ios 应用发布后 .app 应用文件 路径::%@",[NSBundle mainBundle] ); NSLog(@"ios 应用发布后 .app 应用包(文件) 的详细信息::%@",[[...
2012-08-21 15:11:00
178
转载 内存管理中switch的使用
switch (type) { case truthType:question = ...... break; default: question = nil;//这个最好加上 break;转载于:https://www.cnblogs.com/zande...
2012-08-17 15:50:00
116
转载 解决5.0 以下版本自定义 navigationBar 背景图片(the backgroud of the Bar)
解决5.0 以下版本自定义 navigationBar 背景图片原因:在5.0 以下的api 中没有提供setBackgroundImage:(UIImage*)backgroundImage forBarMetrics:(UIBarMetrics)barMetrics 方法this method in 5.x api:- (void)setBackgroundIma...
2012-08-17 10:42:00
90
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人