Post not yet marked as solved
Click to stop watching this thread.
You have stopped watching this post. Click to start watching again.
contentPostList.repliesup-voted.tooltip
I did a little more digging and came across this post "SwiftData. Predicate. Issue accessing self (Entity) inside a Predicate". This gave me the insight into a solution that worked for me. My use case is that I'm using a Picker to select from a stored enum value, and then using that value to build a search predicate. Since stored enum values have an implicit 'self' prepended to their value references (ie. myStoredEnum.value1 could be fully written out as self.myStoredEnum.value1), I was unknowingly throwing sand in the search predicate gears with the implicit 'self'. My workaround is to use an intermediate variable to hold the enum value and then build the search predicate using the intermediate variable instead of directly with the enum value. Yes it's cludgy, but it does seem to work. Hopefully Apple will figure it out so that references to 'self' don't fail in search predicates and we can delete the workaround.