Post

Replies

Boosts

Views

Activity

Data not load if FetchResults in init() methods
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 }
1
0
680
Sep ’21