摘要: snapshot 快照;隆重推荐这个,个人编写代码对版本控制很好用。1、在File中选中 create Snapshot,创建一个快照。2、创建snapshot后,在File文件中选择 restore snapshot,恢复以前保存的版本。3、删除snapshot;在Organizer->projects->选中项目。选中你需要删除的snapshot,点击delete snapshot 就可以删除了。点击export snapshot,可以比较两个版本的修改。 阅读全文
posted @ 2012-12-19 11:17 镇镇 阅读(1127) 评论(4) 推荐(0) 编辑
摘要: core data 网上说不好用,不过还是有必要学习下,毕竟是苹果官方的。1、创建项目,在项目中勾选use core data;此时会在程序的AppDelegate 文件中生成一些core data 操作文件。2、打开.xcdatamodeld文件;选择Add Entity,添加数据库表;选择Add Attribute,添加数据库的列;3、添加数据库模型;选择New File->core data->NSManageObject subclass->勾选需要生成的模型,程序中就添加了UserInfo的两个文件。4、然后就可以使用core data 代码;查询;删除;添加等操作 阅读全文
posted @ 2012-12-18 12:23 镇镇 阅读(208) 评论(0) 推荐(0) 编辑
摘要: NSUInteger componentFlags = NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit;NSDateComponents *components = [[NSCalendar currentCalendar] components:componentFlags fromDate:d];NSInteger year = [components year];NSInteger month = [components month];NSInteger day = [components day];NSStrin 阅读全文
posted @ 2012-04-27 11:47 镇镇 阅读(105) 评论(0) 推荐(0) 编辑
摘要: 一、保存图片到相册1、UIImageWriteToSavedPhotosAlbum( image, self, @selector(..) , nil ) ;2、保存当前界面到相册 #import <QuartzCore/QuartzCore.h> UIGraphicsBeginImageContext(currentView.bounds .size ); //currentView 当前的 view [currentView. layer renderInContext: UIGraphicsGetCurrentContext()]; UIImage *viewImage = 阅读全文
posted @ 2012-04-23 10:25 镇镇 阅读(84) 评论(0) 推荐(0) 编辑
摘要: NSString 转换为 NSDate数据: NSDateFormatter *dateFormatter = [[NSDateFormatteralloc] init]; [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"]; NSDate *date = [dateFormatter dateFromString:@"2012-04-01 12:00:00"]; NSLog(@"%@", date); [dateFormatter release];NSDate 转化为 NSSt 阅读全文
posted @ 2012-04-11 12:01 镇镇 阅读(142) 评论(0) 推荐(0) 编辑