问题标签 [nspersistentdocument]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
71 问题
0
投票
2
回答
199
浏览
macos - macOS Document App SwiftUI 项目上的 NSPersistentDocument FetchRequest 扭曲属性崩溃
Xcode macOS Document App
使用模板创建项目,Use Core Data
选中复选框。- 将 Book 实体添加到
Document.xcdatamodeld
- 将 FetchRequest 扭曲属性添加到
ContentView
,
- 构建并运行,崩溃!
来自控制台的崩溃日志是
几天来我一直在寻找 NSPersistentDocument SwiftUI 示例,但找不到。以下是一些类似或相关的问题。不幸的是,这个问题没有解决。
- 使用 @fetchRequest(entity:) 处理 SwiftUI macOS 应用程序崩溃
- SwiftUI @FetchRequest 使应用程序崩溃并返回错误
- https://developer.apple.com/forums/thread/124656?answerId=417869022#417869022
- https://developer.apple.com/forums/thread/132624
编辑:将此问题项目上传到 Github,https://github.com/donly/DocMacDemo。