計(jì)算時(shí)間差
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轉(zhuǎn)換為string再轉(zhuǎn)換回來(lái)
CGColorRef textDefaultColorRef = blockself.colorChooseView.colorPickerView.color.CGColor;
NSString *textDefaultColorStr = [CIColor colorWithCGColor:textDefaultColorRef].stringRepresentation;
CIColor *color =[CIColor colorWithString:textDefaultColorStr];
UIColor *c = [UIColor colorWithCIColor:color];
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者