Better way to check for null to avoid crashes

Let’s consider this snippet of code:
https://gist.github.com/kmdarshan/80da197f9b2e143fb9c4
Using respondsToSelector:
https://gist.github.com/kmdarshan/fec1374b5c160abf51be
Obviously you can add additional checks, to see the kind of class, check the length and so on.

In

Leave a Reply

Your email address will not be published. Required fields are marked *