序号 | 录入时间 | 录入人 | 备注 |
---|---|---|---|
1 | 2016-07-22 | Alfred Jiang | - |
专题 - iOS 开发调试代码集合
专题 \ iOS \ 开发调试代码
- 提高 iOS 开发调试效率
(无)
NSArray *paths=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory
, NSUserDomainMask
, YES);
NSLog(@"Get document path: %@",[paths objectAtIndex:0]);
NSString *filePath = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"testFile"];
if ([NSKeyedArchiver archiveRootObject:userInfo toFile:filePath]) {
NSLog(@"Save Successed");
}
//Block
void RunBlockAfterDelay(NSTimeInterval delay, void (^block)(void))
{
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, NSEC_PER_SEC * delay),dispatch_get_main_queue(), block);
}
//直接等待
[NSThread sleepForTimeInterval:7.0f];
(无)
(无)