随笔分类 -  oc学习笔记

上一页 1 2 3 4 5 6 7 8 ··· 10 下一页

ios主线程
摘要:dispatch_sync(dispatch_get_main_queue(), ^{ NSLog(@"主队列同步执行"); }); 代码本身就是在主线程中写的,将其放到子线程中就可以避免造成死循环 // dispatch_async(dispatch_get_global_queue(0, 0), 阅读全文

posted @ 2020-03-23 12:10 高彰 阅读(3154) 评论(0) 推荐(0) 编辑

iOS 系统版本判定
摘要:if (@available(iOS 11.0, *)) { NSLog(@"iOS 11以上版本"); } else { NSLog(@"iOS 11以下版本"); } NSString *version = [UIDevice currentDevice].systemVersion; floa 阅读全文

posted @ 2020-03-20 10:41 高彰 阅读(4428) 评论(0) 推荐(0) 编辑

NSMutableArray和NSArray的相互转换
摘要:// NSArray --> NSMutableArray NSMutableArray *myMutableArray = [myArray mutableCopy]; // NSMutableArray --> NSArray NSArray *myArray = [myMutableArray copy]; 阅读全文

posted @ 2019-10-15 13:45 高彰 阅读(341) 评论(0) 推荐(0) 编辑

ios打印超长字符串
摘要://超越打印限制 #define NSLog(format,...) printf("%s",[[NSString stringWithFormat:(format), ##__VA_ARGS__] UTF8String]) 阅读全文

posted @ 2019-10-14 09:44 高彰 阅读(654) 评论(0) 推荐(0) 编辑

iOS 纯代码跳转到Xib界面和Storyboard界面
摘要:纯代码跳转到Xib界面或者Storyboard界面,不能按照一般的跳转写法来跳转,会出现空白界面。 跳转到Storyboard界面 阅读全文

posted @ 2019-09-03 13:57 高彰 阅读(1521) 评论(0) 推荐(0) 编辑

iOS 获取当前app的 App Store 版本号
摘要:NSString * strurl = [[NSString alloc] initWithFormat:@"http://itunes.apple.com/lookup?id=%@",AppIDs];//替换为自己App的ID NSURLSession *session=[NSURLSession sharedSession]; NSURL *url = [NS... 阅读全文

posted @ 2019-09-03 09:59 高彰 阅读(2746) 评论(0) 推荐(0) 编辑

iOS 延时方法,定时器。等待一段时间在执行
摘要:鸣谢:https://www.cnblogs.com/wuotto/p/9354305.html 概述 项目开发中经常会用到方法的延时调用,下面列举常用的几种实现方式: 1.performSelector 2.NSTimer 3.NSThread线程的sleep 4.GCD 1.performSel 阅读全文

posted @ 2019-08-27 16:42 高彰 阅读(1303) 评论(0) 推荐(0) 编辑

iOS获取当前app的名称和版本号及其他信息(持续维护)
摘要:// 1. iOS 获取到的 APP 的信息// iOS获取当前app的名称和版本号 NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];//获取app版本信息 NSLog(@"%@",infoDictionar 阅读全文

posted @ 2019-08-27 16:36 高彰 阅读(3202) 评论(0) 推荐(0) 编辑

iOS 截取字符串(持续更新)截取、匹配、分隔
摘要:截取: NSString *str1 = @"this is zero"; 1.从第三个字符开始,截取长度为2的字符串.........注:空格算作一个字符 NSString *str2 = [str1 substringWithRange:NSMakeRange(5,2)];//str2 = "i 阅读全文

posted @ 2019-08-27 16:32 高彰 阅读(5341) 评论(0) 推荐(0) 编辑

iOS 屏幕大小尺寸,分辨率,代码获取屏幕大小(持续维护添加)
摘要:名称 屏幕分辨率 代码获取屏幕大小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} 阅读全文

posted @ 2019-08-27 16:28 高彰 阅读(723) 评论(0) 推荐(0) 编辑

iOS NSString只保留字符串中的数字
摘要:鸣谢:https://www.cnblogs.com/lulushen/p/9884873.html 阅读全文

posted @ 2019-08-10 15:04 高彰 阅读(1494) 评论(0) 推荐(1) 编辑

iOS NSlog打印数据不完全,xcode处理办法
摘要:在项目中的.pch文件中添加可全局使用。 阅读全文

posted @ 2019-08-01 11:49 高彰 阅读(631) 评论(0) 推荐(0) 编辑

iOS Xcode 10.3 xib:-1:未能找到或创建描述的执行上下文“<IBCocoaTouchPlatformToolDescript
摘要:/Users/hgm/XCode/Gnosys/TGuide/TGPrep/Assets.xcassets:-1: Failed to find a suitable device for the type IBSimDeviceTypeiPad2x (com.apple.dt.Xcode.IBSi 阅读全文

posted @ 2019-07-25 11:11 高彰 阅读(732) 评论(0) 推荐(0) 编辑

iOS 开发-懒加载
摘要:援引:https://www.jianshu.com/p/3287b13c90fb 懒加载 我们知道iOS设备的内存有限,如果程序在启动后就一次性加载将来会用到的所有资源,那么将有可能会耗尽iOS设备的内存。这些资源例如大量数据、图片、音频等等 懒加载:也称延迟加载,说的通俗一点,就是在开发中,当程 阅读全文

posted @ 2019-05-06 12:01 高彰 阅读(231) 评论(0) 推荐(0) 编辑

iOS 1 .Multiple commands produce 错误
摘要:1 .Multiple commands produce 错误 援引: https://blog.csdn.net/qq_41284481/article/details/83017226 用Xcode10跑之前的项目,也就报了一种类型的错误:Multiple commands produce。这个 阅读全文

posted @ 2019-05-06 11:59 高彰 阅读(890) 评论(0) 推荐(0) 编辑

iOS 中文件管理器的使用
摘要:援引:https://www.jianshu.com/p/1ee2619137f9 文章之前,我们先来看下本文的知识大纲: ios中文件管理器的使用.png 1.NSFileManager和NSFilehandle的概念 1.NSFileManager 是 Foundation 框架中用来管理和操作 阅读全文

posted @ 2019-05-06 11:54 高彰 阅读(2166) 评论(0) 推荐(0) 编辑

iOS 沙盒NSUserDefaults 存储可变数组问题 数据持久化
摘要:前言 NSUserDefaults支持的数据类型有:NSNumber(NSInteger、float、double),NSString,NSDate,NSArray,NSDictionary,BOOL. 附:NSUserDefaults 虽然本身不支持自定义对象的存储,不过它支持NSData的类型。 阅读全文

posted @ 2019-05-06 11:52 高彰 阅读(2563) 评论(0) 推荐(0) 编辑

iOS之[文件下载 / 大文件下载 / 断点下载]
摘要:援引:https://my.oschina.net/u/2462423/blog/602519 阅读全文

posted @ 2019-05-06 11:44 高彰 阅读(1474) 评论(0) 推荐(0) 编辑

iOS 游戏素材
摘要:http://www.aigei.com/course/game/ 阅读全文

posted @ 2019-05-06 11:27 高彰 阅读(245) 评论(0) 推荐(0) 编辑

iOS 动画
摘要:在iOS实际开发中常用的动画无非是以下四种:UIView动画,核心动画,帧动画,自定义转场动画。 https://www.jianshu.com/p/40830e8ec61a?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&u 阅读全文

posted @ 2019-05-06 11:25 高彰 阅读(154) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 7 8 ··· 10 下一页
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

导航

统计

点击右上角即可分享
微信分享提示