<p>I have two UIActionSheets and I am thinking that I will control them with one delegate (the UIViewController that instantiates them).  The delegate will capture an actionSheet call and try to figure out which of the two threw the event.</p>

<p>I tried to get the modalView's title to differentiate, but it seems to be invalid...</p>

<p>Should this work? </p>

<p>If not, is there some other way to distinguish which UIActionSheet did the event?</p>

<p>Or do I need to create two different classes that will be separate delegates for each UIActionSheet?</p>

<p>Thanks in advance.</p>

I think you need the
tag
property of the
UIActionSheet
.
Something like:
```
```
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle ... ];
actionSheet.tag = 10;
[actionSheet showInView:self.view];
```
```
Then in your delegate:
```
```
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
  switch (actionSheet.tag) {
    case 10:
      ...
  }
}
```
```
tag
is a property of
UIView
and can be set in Interface Builder for components that appear there too. Quite handy, though I've never actually used it in this context myself.