计算时间差
NSCalendar *cal = [NSCalendar currentCalendar];
unsigned int unitFlags = NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit | NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit;
NSDateComponents *d = [cal components:unitFlags fromDate:date1 toDate:date2 options:0];
int sec = [d hour]*3600+[d minute]*60+[d second];
NSLog(@"second = %d",[d hour]*3600+[d minute]*60+[d second]);
加载UIView的XIB
_replyView = [[[NSBundle mainBundle]loadNibNamed:@"NewRushListView" owner:self options:nil]lastObject];
UIColor转换为string再转换回来
CGColorRef textDefaultColorRef = blockself.colorChooseView.colorPickerView.color.CGColor;
NSString *textDefaultColorStr = [CIColor colorWithCGColor:textDefaultColorRef].stringRepresentation;
CIColor *color =[CIColor colorWithString:textDefaultColorStr];
UIColor *c = [UIColor colorWithCIColor:color];
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。