摘要: 更新 如果UI愿意把启动图切割成n份,按一定约束在launchscreen.storyboard中进行排版,启动图效果会更好。 详见随笔:用launchscreen.storyboard适配启动图方法(二) “使用 Xcode storyboard(故事板) 来提供 app 的启动屏幕”的要求已延期 阅读全文
posted @ 2019-10-12 14:22 Dast1 阅读(25349) 评论(13) 推荐(2) 编辑
摘要: 现象: iOS13黑暗模式开启后,app显示会出现很多意外显示情况。暂时屏蔽是最好的选择。当开启黑暗模式,且在项目的target对应的info.plist中添加以下设置时(禁用黑暗模式): <key>UIUserInterfaceStyle</key> <string>Light</string> 阅读全文
posted @ 2019-10-10 08:10 Dast1 阅读(3769) 评论(0) 推荐(1) 编辑
摘要: 用途 在多线程访问可变变量时,是非线程安全的。可能导致程序崩溃。此时,可以通过使用信号量(semaphore)技术,保证多线程处理某段代码时,后面线程等待前面线程执行,保证了多线程的安全性。使用方法记两个就行了,一个是wait(dispatch_semaphore_wait),一个是signal(d 阅读全文
posted @ 2019-08-22 00:26 Dast1 阅读(400) 评论(0) 推荐(0) 编辑
摘要: iOS墨卡托和GPS坐标计算距离时误差测试,测试结果: 墨卡托和gps坐标来回转换没有误差。 墨卡托坐标计算出的距离比gps坐标计算出的距离大,100/92*100 = 108米,每100米多算出8米。 故随着导航距离缩短,误差会逐渐变小。 log 25.780135+0800 gps_mktDis 阅读全文
posted @ 2019-07-30 21:07 Dast1 阅读(1742) 评论(0) 推荐(0) 编辑
摘要: // // ViewController.m // paintCodeTestOC //gif // Created by LongMa on 2019/7/25. // #import "ViewController.h" @interface ViewController () @propert 阅读全文
posted @ 2019-07-25 11:58 Dast1 阅读(320) 评论(0) 推荐(0) 编辑
摘要: 0.toc被中括号包围,实现自动提取标题生成目录 1.*的用法 一星:黑点 二星:斜体 三星:分割线 四星:粗体 2.#的用法 1级标题 2ji标题 3ji标题 3.u:下划线。就是html标签用法 实现下划线 4.4个波浪线:组成删除线 删除线 5.代码相关: int a = 5; int b = 阅读全文
posted @ 2019-07-13 16:55 Dast1 阅读(242) 评论(0) 推荐(0) 编辑
摘要: 0.toc被中括号包围,实现自动提取标题生成目录 [TOC] 1.*的用法 * 一星:黑点 *二星:斜体* 三星:分割线 * * * **四星:粗体** 2.#的用法 # 1级标题 ## 2ji标题 ### 3ji标题 3.u:下划线。就是html标签用法 <u>实现下划线</u> 4.4个波浪线: 阅读全文
posted @ 2019-07-12 21:02 Dast1 阅读(846) 评论(0) 推荐(0) 编辑
摘要: 1 // 2 // main.c 3 // 统计输入单词数 4 // 5 // Created by LongMa on 2019/6/27. 6 // Copyright © 2019 . All rights reserved. 7 // 8 9 #include <stdio.h> 10 #i 阅读全文
posted @ 2019-06-28 00:37 Dast1 阅读(614) 评论(0) 推荐(0) 编辑
摘要: // // main.c // 数组-冒泡排序 // // Created by LongMa on 2019/6/26. // Copyright © 2019. All rights reserved. // #include <stdio.h> int main(int argc, const 阅读全文
posted @ 2019-06-26 23:27 Dast1 阅读(215) 评论(0) 推荐(0) 编辑
摘要: 结论: alloc负责分配内存和创建对象对应的isa指针; init只是返回alloc生成的对象。 所以alloc后,多次调用init,返回的对象是同一个! 代码如下: 1 // 2 // main.m 3 // alloc.initTest 4 // 5 // Created by LongMa 阅读全文
posted @ 2019-05-30 09:36 Dast1 阅读(198) 评论(0) 推荐(0) 编辑