小编use*_*121的帖子

SiwiftUI:UITextView 正在切换到 TextKit 1

我收到日志消息UITextView 正在切换到 TextKit 1 兼容模式,因为它的 textStorage 包含与NSAttributedString使用的TextKit 2 不兼容的属性。documentType: NSAttributedString.DocumentType.html

例子:

func makeUIView(context: Context) -> UITextView {
    let textView = UITextView()
    return textView
}

func updateUIView(_ uiView: UITextView, context _: Context) {
    var currentText: NSAttributedString?
    let htmlString = "<html><body><h1>Example</h1></body></html>"
    
    guard let encodedData = htmlString.data(using: .utf8) else {
        fatalError("Could not encode HTML data")
    }
    
    do {
        currentText = try NSAttributedString(data: encodedData,
                                             options: [
                                                .documentType: NSAttributedString.DocumentType.html,
                                                .characterEncoding: String.Encoding.utf8.rawValue
                                             ],
                                             documentAttributes: nil)
    } catch let error as NSError {
        fatalError(error.localizedDescription)
    } …
Run Code Online (Sandbox Code Playgroud)

uitextview textkit swiftui ios16

2
推荐指数
1
解决办法
1980
查看次数

Xcode:代码签名身份 - 沙箱权利的核心绘图框架

我将我的mac应用程序转移到itunes connect并收到以下消息:

未启用应用程序沙箱 - 以下可执行文件必须在权利属性列表中包含布尔值为true的"com.apple.security.app-sandbox"权利.有关沙盒应用程序的更多信息,请参阅App Sandbox页面.

因此,我启用了沙箱权利并运行构建.我收到了通知:

指定了CODE_SIGN_ENTITLEMENTS而未指定CODE_SIGN_IDENTITY.如果不对其进行签名,则无法将权利添加到二进制文件中.

接下来,我从目标 - >构建设置中选择了配置文件,然后再次运行.所以,我得到一个错误,这意味着我的代码签名身份不正确,也许在我编译核心情节框架期间.

代码对象根本没有签名...在子组件中:./ Constate/Frame/CorePlot.framework ...命令/ usr/bin/codesign失败,退出代码为1

我该怎么办才能签名?

xcode entitlements core-plot codesign

1
推荐指数
1
解决办法
4009
查看次数