Objective-C: Why check nil before respondsToSelector:?

前端 未结 0 1737
孤街浪徒
孤街浪徒 2021-02-12 02:41

I\'ve seen code like:

if (delegate != nil && [delegate respondsToSelector:@selector(doSomething)]) ...

But, sending a message to

相关标签:
回答
  • 消灭零回复
提交回复
热议问题