Как добавить uiactionsheet в uialertview ??? Я также добавить TableView в alertview, а также хочу, чтобы добавить actionsheet, который имеет четыре кнопки , когда я писал этот код его дает ошибкеДобавить UIActionsheet в UIAlertView
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Preferences"
message:@"\n\n\n\n\n\n\n"
delegate:self
cancelButtonTitle:@"Cancel"
otherButtonTitles:@"OK", nil];
UITableView *myView = [[[UITableView alloc] initWithFrame:CGRectMake(10, 40, 264, 150)
style:UITableViewStylePlain] autorelease];
myView.delegate = self;
myView.dataSource = self;
[alert addSubview:myView];
NSString *actionSheetTitle = @"Action Sheet Demo"; //Action Sheet Title
NSString *destructiveTitle = @"Destructive Button"; //Action Sheet Button Titles
NSString *other1 = @"Other Button 1";
NSString *other2 = @"Other Button 2";
NSString *other3 = @"Other Button 3";
NSString *cancelTitle = @"Cancel Button";
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:actionSheetTitle
delegate:self
cancelButtonTitle:cancelTitle
destructiveButtonTitle:destructiveTitle
otherButtonTitles:other1, other2, other3, nil];
UIView *tempView = [[UIView alloc] initWithFrame:CGRectMake(10, 250, alert.frame.size.width, 250)];
tempView.backgroundColor = [UIColor redColor];
tempView.clipsToBounds = YES;
[alert addSubview:tempView];
[alert addSubview:actionSheet];
[alert show];
[actionSheet showInView:tempView];
[myView reloadData];
Tableview полностью добавить, но actionsheet не добавит. Итак, есть ли какое-либо решение ????
Заранее спасибо
Добро пожаловать на переполнение стека и спасибо за ваш вклад. Хотя ссылка на внешний ресурс может быть полезной, чтобы составить реальные ответы, она часто требует контекста. См. [Ответ], в частности раздел ** Укажите контекст ссылок **. В этом случае объясните, как OP будет использовать это для решения своей проблемы. – jerry