I am trying to migrate to using Xcode 10 on Mojave, coming from using Xcode 8.3.3 on High Sierra. I have a sizeable app containing a fair bit of legacy (non-ARC) code. The app is currently live in the Mac App Store, built with 8.3.3 on High Sierra.
I encountered problems with Xcode 10 and Mojave which took me down a rabbit hole, so I decided to back up and limit the migration to one step at a time. I'm currently attempting (unsuccessfully) to build and run using Xcode 9.4.1 on High Sierra.
Using exactly the same code base (new repo checkout) my app builds and runs fine using Xcode 8.3.3. It builds fine using 9.4.1, but crashes on running.
The problem appears to be memory/reference-counting related. I always get a crash when the app tries to show a window, and the trace is not very helpful. Runtime debug output consistently indicates that I'm sending a message to a deallocated object. Here's a typical stack trace:
Whenever the app tries to show a window, I get messages such as (the old favourite) "message sent to deallocated instance". I don't always recognise the receiver as being one of my properties, so it looks like this is just a symptom, not a cause. Here's a typical message: *** -[NSCalibratedRGBColor release]: message sent to deallocated instance 0x60000605ce60
I've tried in vain to get anything back from Xcode's diagnostics, such as zombies and malloc scribble. Radio silence. Also the static analyser reports no problems. All I can think is that manual reference counting is somehow being treated differently by Xcode 9. I've checked through all the build flags to see if Xcode 9 changed anything. No changes. I've checked the release notes and can find no mention of changes to reference counting.
I can push the problem around by commenting out the display of various panels and windows, but the crash always takes the same form.
Has anyone else come across similar issues and found a solution? Am I missing something with Xcode 9? Any help greatly appreciated.