This one is probably something simple, still learning the ins-and-outs on this but I've run out of searches for this one with no available answer.
I've got a UIViewController with several elements displayed on it, one such element is a UITableView. The UITableView has it's own class and is allocated in the UIViewControllers viewWillAppear
- (void)viewWillAppear:(BOOL)animated
{
UITableView *insideTableView = [[UITableView alloc] init];
tableView.delegate = insideTableView;
tableView.dataSource = insideTableView;
}
Everything is working fine in regards to the tableview. Today I am experimenting with a few additions, one of which is a new view popup on cell selection within that tableview.
Inside my TableView Class, I have the following:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSLog(@"Cell Pressed, Present View");
PopupView *popupView = [[PopupView alloc] initWithNibName:@"PopupView" bundle:nil];
popupView.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[self presentModalViewController:popupView animated:YES];
}
Now it gets called fine, verified by the NSLog, however the view doesn't appear. I know the problem is related to the fact that I want PopUp to appear over the TableViews Parent rather than itself.
I'm just not sure how to properly call it in this instance.
self.parentViewControllerwont work either for this instance. - Mike GabrielUIViewControllerwhose view contains aUITableViewwhich has a delegate (whats the class of the delegate?)? - freespaceviewWillAppearis on theUIViewController, in allocates the TableView and allows it to control itself. Then from within the UITableView class, I populate the table cells which works fine. That's where thedidSelectRowAtIndexPathcomes into play. - Mike GabrielUITableViewto allow it to act as delegate/datasource, or are you really using a subclass ofUITableView? - freespace