GCD延迟执行
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
NSLog(@"延迟执行的任务.");
});
时间格式化
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
NSString *dateStr = [dateFormatter stringFromDate:[NSDate date]];
+ (<#view#> *)instance<#view#>
{
NSArray* nibView = [[NSBundle mainBundle] loadNibNamed:@"<#view#>" owner:nil options:nil];
return [nibView objectAtIndex:0];
}
网友评论