No widget placeholder with core data object

Hello,
My widgets use core data to display informations, so for placeholder I create an example object that's going be used only for that placeholder.
I only get a blank, why ?
If I set the task to nil the view appear correctly, because in that case my view display only a Text.
I looks like I can't use a NSManagedObject subclass for constructing my view

Code Block
func placeholder(with: Context) -> TaskEntry {
        let tmpContext = NSManagedObjectContext(concurrencyType: .mainQueueConcurrencyType)
        let task = Task(context: tmpContext)
        
        let subject = Subject(context: tmpContext)
        subject.title = "Oriented object Programming"
        task.subject = subject
        
        task.title = "learning abstract classes"
        
        task.deadline = Calendar.current.date(byAdding: .day, value: 1, to: Date())
        return TaskEntry(date: Date(), task: nil)
    }



I have some other weird behaviours :
  • for a widget I get a blank view as placeholder (small), for another size I got the placeholder for when the property is nil but it isn't.

Both widgets should have the same placeholder and the filled one.
  • Just tested with an empty timeline for my second widget:

For that one that's the opposite, the medium is blank but this time the small one isn't showing a blank view or the version off the placeholder when the property is nil but a Text("Placeholder small").
How is that possible if this text isn't win my code ? It was there in a previous version but not the current one.

These bugs added to the fact when I run the iOS app widgets no longer work and placeholder is showed and they disappear from widget gallery. (a restart fix that)
So i have to run the app directly from widget target in Xcode.


All softwares are in beta 3, I tried clean build folder, restart device and Xcode



widgetURL also working only for medium size and sometimes not at all
No widget placeholder with core data object
 
 
Q