Objective-C: Why check nil before respondsToSelector:?

前端 未结 0 532
孤城傲影
孤城傲影 2021-02-12 02:35

I\'ve seen code like:

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

But, sending a message to

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