Modify Surround With "if respondsToSelector" behavior?

I love the Surround With if respondsToSelector, particularly since AppCode doesn't do a particularly good job of suggesting selector completions on protocols. However, it's annoying that AppCode insists on extracting the target object into a variable "o" that gets used in both the if statement and the actual call:

[self.delegate multipeerConnectionDidOpenConnection:self];


id <MultipeerConnectionDelegate> o = self.delegate;
([o respondsToSelector:@selector(multipeerConnectionDidOpenConnection:)]) {
    [o multipeerConnectionDidOpenConnection:self];

It's unnecessary and somewhat confusing, so I have to take the time to copy "self.delegate" and paste it back in place of the "o" variables, then deleting the first line. I would like the option to disable the variable extraction for this operation. Thanks!

Comment actions Permalink

Joshua, may we ask you to file a request in the tracker?

Comment actions Permalink

I'd be happy to... what's the URL? Is it just the regular Issue Tracker?

Comment actions Permalink

Yes, it's a regular public issue tracker, here you go:


Please sign in to leave a comment.