开发者

UIPopoverController hierarchy/inheritance with other ViewControllers

开发者 https://www.devze.com 2023-03-13 12:16 出处:网络
I have a BaseController and three subclass ViewControllers.In each of the subclass ViewControllers, a query is made to the sqlite database to get the information.I want to add a longPress feature at t

I have a BaseController and three subclass ViewControllers. In each of the subclass ViewControllers, a query is made to the sqlite database to get the information. I want to add a longPress feature at the BaseController level to pop up a UIPopoverController.

So then I have a subclass of UITableViewController to be used with the UIPopoverController to display the data. Do I need to get the information from the sqlite database in my subclass of UITableViewController to have that information be displayed in UIPopoverController? It seems redundant since my 3 subclasses of the Ba开发者_JAVA技巧seController already have the data, and now I just want to have that data in a UIPopoverController, as well as add additional functionality like when a row is selected from the UIPopovercontroller.


The UIPopoverController is a view controller. SO: display the table.view in the UIPopoverController.

As far as adding functionality to a row press:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
 // in here write what happens. if its row specific write:
  /// if (indexPath.row == ROWNUMBER){method} (rows start at 0)
}

and all of this goes in the .m file of the tableView you are presenting

0

精彩评论

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