开发者

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]; 
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜