I noticed methods marked optional in several protocols defined in the iPhone SDK, such as the UIActionSheetDelegate protocol for example.
UIActionSheetDelegate
How can I defi
Use the @optional keyword before your method declaration to make it optional. Simple as that!
@optional
// myProtocol.h @protocol myProtocol - (void)myMandatoryMethod:(id)someArgument; @optional - (void)myOptionalMethod:(id)someArgument; @end
// myClass.m @interface myClass : someSuperClass //... @end