2014年7月10日

Quartz 2D绘图

摘要: Quartz 2D绘图只能在UIView中重写drawRect:方法中进行绘制,其他地方都无效,会报错。绘制过程:1. 获取上下文 CGContextRef context = UIGraphicsGetCurrentContext();2. 添加图形 CGContextAddRect(contex... 阅读全文

posted @ 2014-07-10 23:42 馅饼在哪颗星 阅读(356) 评论(0) 推荐(0) 编辑

2014年7月8日

手势识别

摘要: iOS目前支持的手势识别UITapGestureRecognizer(点按)UIPinchGestureRecognizer(捏合)UIPanGestureRecognizer(拖动)UISwipeGestureRecognizer(轻扫)UIRotationGestureRecognizer(旋转... 阅读全文

posted @ 2014-07-08 22:42 馅饼在哪颗星 阅读(219) 评论(0) 推荐(0) 编辑

2014年6月26日

多视图控制器跳转方法

摘要: 1.Modal:打开:presentViewController关闭:dismissViewController2.Push:需搭配NavigationController使用,采用压栈和出栈的方式打开:pushViewController关闭:popViewController3.Segue:以上... 阅读全文

posted @ 2014-06-26 17:13 馅饼在哪颗星 阅读(288) 评论(0) 推荐(0) 编辑

2014年6月17日

NSString和NSDate的转换

摘要: 输入的日期字符串形如:@"1992-05-21 13:08:08"- (NSDate*)dateFromString:(NSString*)dateString{NSDateFormatter*dateFormatter = [[NSDateFormatter alloc]init];[dateFo... 阅读全文

posted @ 2014-06-17 10:27 馅饼在哪颗星 阅读(200) 评论(0) 推荐(0) 编辑

2014年6月9日

遍历子视图中某个类型控件方法

摘要: NSMutableArray *textFieldArray = [NSMutableArray arrayWithCapacity:5]; for (UIView *textField in self.view.subviews) { if ([textFiel... 阅读全文

posted @ 2014-06-09 22:49 馅饼在哪颗星 阅读(211) 评论(0) 推荐(0) 编辑

2014年6月6日

发布程序后的NSLog批处理

摘要: NSLog在开发中是必须使用到的,但是其本身是特别耗费性能的,所以在产品发布后是一定要去掉的。在大的开发项目中一个个处理NSLog是相当困难的,所以可以考虑在pch文件中进行宏定义,如:#define MyLog(...) NSLog(__VA_ARGS__)待程序发布时可以将后面的NSLog(__... 阅读全文

posted @ 2014-06-06 11:14 馅饼在哪颗星 阅读(341) 评论(0) 推荐(0) 编辑

2014年6月2日

searchDisplayController用法

摘要: #pragma mark - 搜索栏代理方法- (BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchString:(NSString *)searchStrin... 阅读全文

posted @ 2014-06-02 17:40 馅饼在哪颗星 阅读(510) 评论(0) 推荐(0) 编辑

2014年5月29日

UIImagePickerController使用方法

摘要: 点击按钮后弹出图片库选择图片,然后返回给Button的image。- (IBAction)selectIcon { UIImagePickerController *imagePicker = [[UIImagePickerController alloc]init]; //设置图库源 ... 阅读全文

posted @ 2014-05-29 23:33 馅饼在哪颗星 阅读(343) 评论(0) 推荐(0) 编辑

2014年5月28日

沙盒目录常用获取方式

摘要: 获取程序的Home目录 NSString *home = NSHomeDirectory();注意: 虚拟机Home目录: /Users/userName/Library/Application Support/iPhone Simulator/6.1/Applications/C926CCFA-A... 阅读全文

posted @ 2014-05-28 20:29 馅饼在哪颗星 阅读(286) 评论(0) 推荐(0) 编辑

2014年5月20日

Archive&Unarchive

摘要: Archive(归档)需要归档的对象必须要遵循NSCoding协议,那么在调用archiverRootObject方法的时候,会自动调用该对象的encodeWithCoder方法- (void)encodeWithCoder:(NSCoder *)aCoder{ [aCoder encodeO... 阅读全文

posted @ 2014-05-20 20:53 馅饼在哪颗星 阅读(356) 评论(0) 推荐(0) 编辑

导航