Passing an NSArray as otherButtonTitles - iOS
Currently i'm using
...otherButtonTitles:@"Hotel Laguna", @"Hotel Village", @"Hotel Torre", @"Hotel Baia", nil];
开发者_StackOverflow中文版
to create an UIActionSheet
.
I would like to pass an NSArray... something like:
NSArray *names = [[NSArray alloc]
initWithObjects:@"Hotel Laguna", @"Hotel Village", @"Hotel Torre", @"Hotel Baia", nil];
...otherButtonTitles:names];
Is this possible in some way?
Thanks!
You can add otherButtonTitles
by enumerating through an array if you have objects in an array like this:
(NSString * title in Strings)
{
[alert addButtonWithTitle:title];
}
精彩评论