Xcode 11.4 beta crash on @Published property subscription. What's going on?

前端 未结 1 426
盖世英雄少女心
盖世英雄少女心 2021-01-04 11:50

I do not know why but my code crashes on this $searchTerm publisher. I have many such publishers in my code and everything else works ok. It only does not work in this new X

相关标签:
1条回答
  • 2021-01-04 12:14

    If searchTerm is something declared in your class or its superclass then mark it as final. In my experience this fixes this issues all the time.


    My theory is that Swift can't figure out which field from lookup tables is $searchTerm is referring, hence the crash. Where as, marking it as final will make it dispatch statically. I'm not sure whether this is actually true or not, if anyone has more knowledge on subject please make a comment and I'll update my answer.

    0 讨论(0)
提交回复
热议问题