Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which NSAssertion should I use inside a block?

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?

like image 211
Ricardo Avatar asked Dec 01 '15 15:12

Ricardo


Video Answer


1 Answers

I generally use NSCAssert() in these cases. It doesn't pass self and is also useful for assertions inside of C functions.

like image 158
Rob Napier Avatar answered Oct 04 '22 16:10

Rob Napier