imhuntingwabbits
imhuntingwabbits
Excellent. I haven't done a very thorough pass but this looks exactly like the evolution I was asking for in #398.
`isDeallocating` is a racey lie. It's maybe useful as a debugging check but in that case it should be a harder failure (like a process abort / trap). IMO this...
`__weak` is a bit of a trap in that it autoreleases all strong references to the pointer. So anywhere you use it you need to include a local pool if...
> I'd appreciate suggestions out of the trap I'm in where a mock is being called with self as an argument in dealloc. Academically this trap happens because we are...
``` Cannot form weak reference to instance (0x7f9ab2c02520) of class TestClassThatCallsDelegateOnDealloc. It is possible that this object was over-released, or is in the process of deallocation. ``` That looks like...
I don't know what this means: > The code that is "broken" is Apple-required code before iOS 9, and a code pattern which is still supported by Apple. The client's...
> I might agree on the -andReturn: case though. How is that ever valid from within a dealloc method? I may be missing something there. Obviously, we *really * don't...
> For example, are you saying that users should not be allowed to write tests which ensure that notification observers get removed? Not at all. I'm implying that attempting to...
> But isn't that exactly what this test case is doing? Trivially yes. What does this have to do with not establishing strong references to deallocating objects? ``` - (void)testHandlesCallingMockWithSelfAsArgumentInDealloc...
> Incorrect. Because the go: method is stubbed, it calls into the forwardInvocation implementation of OCMock at this point, and thus its handleInvocation: methods. OCMock wants to keep the information...