Although the primary target for my app is iOS, I am working on an OS X version for bootstrapping my data. It is simply more convenient to do it on the Mac than in the simulator.
However, I am finding that using bindings with Swift2 is introducing some strong references that ARC isn't releasing. Specifically, I am finding that:
1) Calling the "bind" method establishes a strong reference, even when I use weak or unowned. I can release it using only using "unbind". But,
2) Defining outlineView:objectValueForTableColumn:byItem: introduces a strong reference that I can't release
I realize that OS X isn't a big market anymore and I'm really focused on iOS now. But with legacy Cocoa and the new Swift2, should we try to drop any OS X feature that doesn't exist on iOS too? Some of these things, like bindings, are nice features but there are alternatives.
This really sounds like a Cocoa bug, but I'm only seeing it in Swift. I can't reproduce it in a demo application. It only happens in my big app with 1500 files. But if I avoid those two issues above, it work perfectly. I cannot find any strong reference cycles. Merely changing bind to target/action resolves the problem entirely.
Has anyone else seen anything similar or have any ideas? My inclination is just to never use anything that won't work on iOS. It seems that OS X APIs are dead-end.