我在iOS目标的Xcode11.4 (11E146)中记录兴趣点时遇到了问题。我假设这是一个bug,并且已经提交了bug报告(FB7639664),但是我想知道其他人是否也有问题。或者,是否有一些模糊的选项阻碍了它的正常显示?我在“记录选项”下看不到任何明显的“兴趣点”...
无论如何,请考虑下面的代码:
import UIKit
import os.log
private let pointsOfInterest = OSLog(subsystem: "PointsOfInterestDemo", category: .pointsOfInterest)
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
os_signpost(.event, log: pointsOfInterest, name: #function)
}
@IBAction func didTapStartRange(_ sender: Any) {
let id = OSSignpostID(log: pointsOfInterest)
os_signpost(.begin, log: pointsOfInterest, name: #function, signpostID: id)
DispatchQueue.main.asyncAfter(deadline: .now() + 3) {
os_signpost(.end, log: pointsOfInterest, name: #function, signpostID: id)
}
os_log(#function)
}
@IBAction func didTapSignpost(_ sender: Any) {
os_signpost(.event, log: pointsOfInterest, name: #function)
os_log(#function)
}
}在Xcode 11.3.1中,如果我分析并点击几个按钮,我会得到:

但是在Xcode11.4中同样的过程会导致:

请注意,我显示的是控制台,因此您可以看到正在发生的点击,但没有任何关注点。
它适用于Xcode 11.3.1 (11C505),但不适用于Xcode 11.4 (11E146)。在Xcode11.4中,它适用于macOS目标,但不适用于iOS目标。我在MacBook专业版(15英寸,2018)上运行Catalina10.15.4 (19E266)。我也尝试了延迟录制和使用较旧的模拟器版本,但都没有任何乐趣。
顺便说一句,虽然我报告了它对macOS目标有效,但我确实看到了一些可疑的行为,我的macOS目标的兴趣点有一小段时间是空白的,但很快就回来了。虽然这很可能是无关的,但考虑到iOS中的错误行为,它也没有给macOS实现注入信心。
发布于 2020-04-03 15:03:09
FWIW,苹果已经承认了这个问题,并随后修复了这个错误。
https://stackoverflow.com/questions/60854512
复制相似问题