I wrote an objective-C class that needs to notify another class, so i defined a protocol for a delegate:
@protocol glob_protocol <NSObject>
@required
- (IBAction) call:(int) val val2:(int) val2;
@end
In my class i have a member to store the delegate:
IBOutlet id <glob_protocol> delegate;
When connecting the classes / instances in the Interface Builder there is no type checking now. I can connect any class as a delegate.
Is there a way to enable type checking? I’d like that only classes / instances that implement the protocol can be set as delegates.
Thanks for any hints,
Torsten.
EDIT:
I just checked in the Header files of UIKit to see if there are any additional infos or keywords but i did not find any. I wonder where InterfaceBuilder got tthe information from what instances can be set as delegate.
this usually works:
although that’s not at the level/phase you want, it works well because connections don’t change often.