The common pattern to declare delegates when using ARC is using a weak ownership:
1 2 3
However using a weak delegate this way recently failed without apparent reason:
1 2 3 4
I was testing my class using OCMock and used
+[OCMockObject mockForProtocol:] to create my delegate. Turns out OCMock is creating mocked objects as
NSProxy subclasses, and ARC has issues with weak references to proxies.
More people with the same issues when using OCMock and ARC narrowed this problem down.