将Xcode更新至14.* 之后,如果项目中集成了Charts,在编译过程中ChartDataSet文件会报以下错误,导致无法编译; Type 'ChartDataSet' does not conform to protocol 'RangeReplaceableCollection' Unavailable instance method 'replaceSubrange(_:with:)' was used to satisfy a requirement of protocol 'RangeReplacea…
在macOS (Monterey 12.6.3)上使用Homebrew安装包时提供了以下错误: Error: Permission denied @ apply2files - /usr/local/lib/node_modules/docsify 此错误在其他macOS版本中也有出现,主要原因是需要在macOS升级之后重置/usr/local中的权限 ⚠️:如果提示的错误软件包你不使用的话,可以不用理会; 解决方法 在终端中执行以下命令(记得全选): sudo chown -R $(whoami):…
翻译自苹果官方文档:Understanding and Analyzing Application Crash Reports nimo: 这篇长达1w多字的文章,大概前后翻译了一个月,“写”了三遍:第一遍是直译,第二遍是把直译改成程序员看着舒服的“行话”,第三遍是把原文里说的过于抽象或者简单的部分加上我的注解(大家看见所有以nimo开头的部分)。 文章发布后我才发现,这并不是针对iOS Crash report唯一的翻译版本。哪篇翻译的更好这个见仁见智,但我希望这篇是翻译的最用心的版本。 当app发…
建立两个数组用于测试演示,需要注意的是first为可变数组 var first = ["张三", "李四"] let second = ["王五", "赵六"] 方法一 first.append(contentsOf: second) print(first) // ["张三", "李四", "王五", "赵六"] 方法二 first += second print(first) //["张三", "李四", "王五", "赵六"] 方法三 let third = first + sec…
给定一个示例Array数组 var animals = ["cats", "dogs", "chimps", "moose"] Array删除第一个元素 animals.removeFirst() // "cats" print(animals) // ["dogs", "chimps", "moose"] Array删除最后一个元素 animals.removeLast() // "moose" print(animals) // ["cats", "dogs", "chimps"] Array删除…
将UIButton添加至UIBarButtonItem var button: UIButton = UIButton() button.setImage(UIImage(named: "cameraIconInactive"), forState: .Normal) button.frame = CGRectMake(0, 0, 45, 45) button.targetForAction("pushProfileToCamera", withSender: nil) var rightItem:U…
字典转字符串 Dictionary To String 字符串转字典 String To Dictionary
iPhone 13 Pro Max does not support the architecture of the selected executable. Switch to a device that supports x86_64. 好几天没有打开项目,更新Xcode到Version 13.4.1 (13F100) 之后,项目无法通过模拟器启动;
介绍:C系列对于nullable的解释: nullable C 渊源:在Xcode6.3中使用了双下划线的版本,但是由于和第三方库的潜在冲突,所以苹果在Xcode 7 中修改为单下划线+首字母大写;后续为了和旧版本Xcode兼容,继续使用双下划线的版本,也就是两种是等价的。 Apple Swift 博客 区别:区别在于单下划线和双下划线需要放在类型定义之后,而非下划线的需要放在类型定义前。 nonnull,nullable,null_unspecified _Nonnull,_Nullable,_Null_unsp…