If I use the following code, the project works normal.
let listRequest = FetchRequest<ReminderList>(entity: ReminderList.entity(), sortDescriptors: [NSSortDescriptor(key: "title", ascending: true)])
var lists: FetchedResults<ReminderList> {
return listRequest.wrappedValue
}
But if I put lists variable in init() method (the following), the data not load. I don't know why.
let listRequest = FetchRequest<ReminderList>(entity: ReminderList.entity(), sortDescriptors: [NSSortDescriptor(key: "title", ascending: true)])
var lists: FetchResults<ReminderList>
init() {
self.lists = listRequest.wrappedValue
}
Post
Replies
Boosts
Views
Activity
Newest Xcode 12(12A7209) updating from App Store, catalina 10.15.6
The following simple codes could not run normally in playground in Xcode. Get the following message:
error: Execution was interrupted, reason: signal SIGABRT.
import Foundation
import SwiftUI
import PlaygroundSupport
struct ContentView: View {
let appleProducts: Array<String> = ["iPod", "iPhone", "Macbook", "Macbook Pro", "Mac Pro"]
var body: some View {
ScrollView(.horizontal, showsIndicators: false) {
HStack {
ForEach(0..<5) {
Text("\($0)")
}
}
}
}
}
PlaygroundPage.current.setLiveView(ContentView())