We cannot use NSAssertion inside blocks because that macro uses self, creating a retain cycle, as commented here: http://www.takingnotes.co/blog/2011/09/27/making-nsassert-play-nice-with-blocks/ My question is, what kind of assertions should I use inside a block?
I generally use NSCAssert()
in these cases. It doesn't pass self
and is also useful for assertions inside of C functions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With