1

0126 - SwiftData 中的一个坑

 7 months ago
source link: https://atjason.com/daily/2024-01-26.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

0126 - SwiftData 中的一个坑

2024-01-26

| 每天写一点

被 SwiftData 一个小问题搞了。

我在 @Model 中定义了 isDeleted 属性,调试发现死活更新不了。

折腾了半天,偶然发现原来 PersistentModel 本身就 isDeleted 属性,被官方占用了。而我自己定义相同名字的属性,编译、运行啥的,什么错也没有。但实际上,完全不是自己预想的那么回事。

得,又踩一坑。


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK