Well, the general fix is to use an explicit message send instead of performSelector:
, because performSelector:
expects the method to return an object and won't always work correctly when the method returns something else. So you want return [NSNumber numberWithChar:[obj whateverSelContains]]
.
However, you can probably use Key-Value Coding as a substitute for performSelector:
here. It's hard to say without seeing your real code, but assuming this is a no-argument method that returns a char, that approach should work. In that case, you'll want a string instead of a SEL. Then you can do [[obj valueForKey:whateverWasInSel] charValue]
and that will work.