Sorry I’m new to iOS. I intend to make an UITableView inside UIAlertView. Finally i have gotten this tutorial
I have implemented UIAlertTableView class this way
UIAlertTableView *alert = [[UIAlertTableView alloc] initWithTitle:@"Choose a number"
message:nil
delegate:self
cancelButtonTitle:@"Cancel"
otherButtonTitles:nil, nil];
alert.tableDelegate = self;
alert.dataSource = self;
alert.tableHeight = 120;
[alert show];
However after testing, i got the UIAlert displayed a blank list, with no items appear inside. Previously i have an NSMUtableArray that i want to use as data source. From the tutorial above, seems that assigning data source is done using alert.dataSource = self. Yet i’m still wondering how to use my NSMutableArray as the data source and how it relates to alert.dataSource?
I’ll suggest you need to create a new file as your alertView’s table datasource and delegate.
Implement the:
Create the alert like:
Note:
I implemented that alertView for testing, there are alot of issues.
You need to call:
[self layoutAnimated:YES];instead of[self setNeedsLayout];in the alertView class.