Your if ... respondsToSelector: selector
won't work because your selector
is just the name of the method. For your case you need to check
if ([delegate respondsToSelector: @selector(method::)]
and for the other case just for method:
.
Anyway, you can supress the warning like this:
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
[self performSelector:nextView];
#pragma clang diagnostic pop
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…