It turns out that +alloc is not used at least for some objects loaded from .storyboards (nibs?), but +allocWithZone: is used instead. Particularly, in my case I saw it like deallocations tracked for navigation controllers (when they're disposed), without tracking allocations, hence the (live) count of navigation controllers in currentAllocationSummary eventually decreased below zero.
You can easily check it yourself with storyboards, I've added unit test illustrating the problem as well.
Overall I believe it makes sense to patch +allocWithZone: instead of +alloc just because it's kind of historical thing (and was used freely in "old" source bases) - otherwise you had a great chance to miss it like in this case with storyboards.
This is iteration on #29 after fixing #35.
It turns out that
+alloc
is not used at least for some objects loaded from .storyboards (nibs?), but+allocWithZone:
is used instead. Particularly, in my case I saw it like deallocations tracked for navigation controllers (when they're disposed), without tracking allocations, hence the (live) count of navigation controllers incurrentAllocationSummary
eventually decreased below zero.You can easily check it yourself with storyboards, I've added unit test illustrating the problem as well.
Overall I believe it makes sense to patch
+allocWithZone:
instead of+alloc
just because it's kind of historical thing (and was used freely in "old" source bases) - otherwise you had a great chance to miss it like in this case with storyboards.