Ever gotten warnings such as "PerformSelector may cause a leak because its selector is unknown" when you send -performSelector:withObject:
with the selector as a variable (that you know will contain a valid selector)? That's where #pragma
is very useful. Do this to disable the warning for a specific chunk of code:
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
[self.proxiedTarget performSelector:someSelectorVar withObject:obj];
#pragma clang diagnostic pop
Your feedback is valuable: Do you want more nuggets like this? Yes or No
.