Should I use Cocoa bindings for my latest project?

前端 未结 7 776
执念已碎
执念已碎 2020-12-25 08:45

I\'m starting a project which I think would benefit from bindings (I\'ve got a source list table, several browser views, etc), but I think it would also be quite doable, and

7条回答
  •  青春惊慌失措
    2020-12-25 09:24

    My opinion is that yes, you should adopt bindings; the technology is well-understood and stable now, and it's worth doing for the amount of code you no longer need to write. When I first switched to bindings, I had quite a bit of trouble with getting the lifetime of observing and observed objects to match up, and with UI breakages because it was observing a valid object, but the incorrect one. Once you've seen those problems a couple of times, knowing how to avoid them and how to spot them if they do appear becomes straightforward. Ish. I still wish for "this event here caused this update here" traces in the debugger, but I'm still glad I made the move.

提交回复
热议问题