Using Xcode 12, on a release build which uses -Os, MMTabBarView was crashing in some circumstances after creating a tab.
Enabling Zombie detection, I could see it complained about an MMAttachedTabBarButton being released. The problem went away if using -O0 (Add "GCC_OPTIMIZATION_LEVEL = 0" to Release.xcconfig).
The existing code overloaded NSCell controlView with different types. There were compiler warnings about this recommending unsafe retain, so I think the ARC compiler somehow optimised the memory management for these badly.
There was also comments by these properties saying "TODO: fix, rename". So I went ahead and renamed them and updated the controlView accessor methods. There was also some fiddling about with nullable to keep the compiler happy.
Xcode 12 still gives a load of warnings:
Use of '@import' in framework header is discouraged, including this header requires -fmodules
and a linker warning:
ld: warning: dylib (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/lib/darwin/libclang_rt.ubsan_osx_dynamic.dylib) was built for newer macOS version (10.10) than being linked (10.9)
Using Xcode 12, on a release build which uses -Os, MMTabBarView was crashing in some circumstances after creating a tab.
Enabling Zombie detection, I could see it complained about an MMAttachedTabBarButton being released. The problem went away if using -O0 (Add "GCC_OPTIMIZATION_LEVEL = 0" to Release.xcconfig).
The existing code overloaded NSCell controlView with different types. There were compiler warnings about this recommending unsafe retain, so I think the ARC compiler somehow optimised the memory management for these badly.
There was also comments by these properties saying "TODO: fix, rename". So I went ahead and renamed them and updated the controlView accessor methods. There was also some fiddling about with nullable to keep the compiler happy.
Xcode 12 still gives a load of warnings:
and a linker warning:
but those are something to fix another day.