摘要:dispatch_sync(dispatch_get_main_queue(), ^{ NSLog(@"主队列同步执行"); }); 代码本身就是在主线程中写的,将其放到子线程中就可以避免造成死循环 // dispatch_async(dispatch_get_global_queue(0, 0),
阅读全文
摘要:if (@available(iOS 11.0, *)) { NSLog(@"iOS 11以上版本"); } else { NSLog(@"iOS 11以下版本"); } NSString *version = [UIDevice currentDevice].systemVersion; floa
阅读全文
摘要:// NSArray --> NSMutableArray NSMutableArray *myMutableArray = [myArray mutableCopy]; // NSMutableArray --> NSArray NSArray *myArray = [myMutableArray copy];
阅读全文
摘要://超越打印限制 #define NSLog(format,...) printf("%s",[[NSString stringWithFormat:(format), ##__VA_ARGS__] UTF8String])
阅读全文
摘要:纯代码跳转到Xib界面或者Storyboard界面,不能按照一般的跳转写法来跳转,会出现空白界面。 跳转到Storyboard界面
阅读全文
摘要:NSString * strurl = [[NSString alloc] initWithFormat:@"http://itunes.apple.com/lookup?id=%@",AppIDs];//替换为自己App的ID NSURLSession *session=[NSURLSession sharedSession]; NSURL *url = [NS...
阅读全文
摘要:鸣谢:https://www.cnblogs.com/wuotto/p/9354305.html 概述 项目开发中经常会用到方法的延时调用,下面列举常用的几种实现方式: 1.performSelector 2.NSTimer 3.NSThread线程的sleep 4.GCD 1.performSel
阅读全文
摘要:// 1. iOS 获取到的 APP 的信息// iOS获取当前app的名称和版本号 NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];//获取app版本信息 NSLog(@"%@",infoDictionar
阅读全文
摘要:截取: NSString *str1 = @"this is zero"; 1.从第三个字符开始,截取长度为2的字符串.........注:空格算作一个字符 NSString *str2 = [str1 substringWithRange:NSMakeRange(5,2)];//str2 = "i
阅读全文
摘要:名称 屏幕分辨率 代码获取屏幕大小iphone X 2436 x 1125 {375 ,812} iphone XR 1792 x 828 {414 ,896} iphone XS 2436 x 1125 {375 ,812} iphone XS Max 2688 x 1242 {414 ,896}
阅读全文
摘要:鸣谢:https://www.cnblogs.com/lulushen/p/9884873.html
阅读全文
摘要:/Users/hgm/XCode/Gnosys/TGuide/TGPrep/Assets.xcassets:-1: Failed to find a suitable device for the type IBSimDeviceTypeiPad2x (com.apple.dt.Xcode.IBSi
阅读全文
摘要:援引:https://www.jianshu.com/p/3287b13c90fb 懒加载 我们知道iOS设备的内存有限,如果程序在启动后就一次性加载将来会用到的所有资源,那么将有可能会耗尽iOS设备的内存。这些资源例如大量数据、图片、音频等等 懒加载:也称延迟加载,说的通俗一点,就是在开发中,当程
阅读全文
摘要:1 .Multiple commands produce 错误 援引: https://blog.csdn.net/qq_41284481/article/details/83017226 用Xcode10跑之前的项目,也就报了一种类型的错误:Multiple commands produce。这个
阅读全文
摘要:援引:https://www.jianshu.com/p/1ee2619137f9 文章之前,我们先来看下本文的知识大纲: ios中文件管理器的使用.png 1.NSFileManager和NSFilehandle的概念 1.NSFileManager 是 Foundation 框架中用来管理和操作
阅读全文
摘要:前言 NSUserDefaults支持的数据类型有:NSNumber(NSInteger、float、double),NSString,NSDate,NSArray,NSDictionary,BOOL. 附:NSUserDefaults 虽然本身不支持自定义对象的存储,不过它支持NSData的类型。
阅读全文
摘要:援引:https://my.oschina.net/u/2462423/blog/602519
阅读全文
摘要:http://www.aigei.com/course/game/
阅读全文
摘要:在iOS实际开发中常用的动画无非是以下四种:UIView动画,核心动画,帧动画,自定义转场动画。 https://www.jianshu.com/p/40830e8ec61a?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&u
阅读全文