<p>I noticed methods marked optional in several protocols defined in the iPhone SDK, such as the <code>UIActionSheetDelegate</code> protocol for example.</p>

<p>How can I define a protocol of my own, and set a few of the methods as optional?</p>

Use the
```
@optional
```
keyword before your method declaration to make it optional. Simple as that!
```
```
// myProtocol.h
@protocol myProtocol
- (void)myMandatoryMethod:(id)someArgument;
@optional
- (void)myOptionalMethod:(id)someArgument;
@end
```
```
```
```
// myClass.m
@interface myClass : someSuperClass <myProtocol>
    //...
@end
```
```