I doubt there's any way to prevent this.
Objective-C class, method, property, protocol, and category information is all registered dynamically at runtime. Therefore, your executable's __DATA
section must contain all of this information. Tools like class-dump
simply reverse engineer these tables to create an equivalent interface (.h
) file.
The only way to get around this would be to programmatically create your classes at runtime, which in my opinion would be just crazy.
An ugly, half-solution—full of potential problems—would be to try some form of code obfuscation:
#define MyClass m0
#define doSomething m1
#define userClickedButton m2
#define hitCount m3
@interface MyClass
- (void)doSomething;
- (IBAction)userClickedButton:(id)sender;
@property NSUInteger hitCount;
would appear in the compiled application as
@interface m0
- (void)m1;
- (void)m2:(id)o;
- (unsigned long)m3;
- (void)setM3:(unsigned long)n;