English 中文(简体)
审计长
原标题:Refreshing Master TableView of a UISplitView Controller

在把我们最新的Pipe寄给一个世界观的同时,我决定在塔巴勒河内使用一个Id s SplitView主计长。 SplitViewController由Appelegate管理。

All works fine, but my problem is that my MasterView (on the left of the SplitView) includes 4 Category-Buttons to change the TableViews Data. If I click one of the buttons, the TableView needs to Refresh/ReloadData, to Display the new Content of the selected category. I created a function to do the changes and linked my buttons to it in the interface builder.

At the end of my function, I tried to refresh the Controller like this:

[self tableView ReloadData];

but the SplitView don t show the refresh. Still the old Data. I tested around a bit with NSLog, to check if my function works correctly. No problems.

接着,我试图通过SplitViewController本人来查阅这封信:

   // PresetController is my TableViewController in the SplitView  
    UISplitViewController *split = (UISplitViewController *)self.parentViewController;    
    PresetController *detail = [split.viewControllers objectAtIndex:0];   

    [detail.tableView reloadData];

同样,没有错误,但没有复读。

我失踪了吗? 是否有办法轻松地重载SplitViewController。 我已经读过通过通知中心向代表发送通知的内容,但是仍然找不到有用的资源。

http://www.un.org。

为了理解我的结构,我以什么方式在我的“提名”中设立SplitView。 方法:

NSMutableArray *controllers = [NSMutableArray arrayWithCapacity:[self.rootController.viewControllers count]];

        int tabNum = 0;
        for (UIViewController *controller in self.rootController.viewControllers) {



                UISplitViewController *split = [[[UISplitViewController alloc] init] autorelease];
                split.tabBarItem = controller.tabBarItem;
                iPadDetailView *detail = [[iPadDetailView alloc] initWithNibName:@"iPadDetailView" bundle:nil]; // a detail view will come here
                UINavigationController *nav = [[[UINavigationController alloc] initWithRootViewController:detail] autorelease];

                split.viewControllers = [NSArray arrayWithObjects:controller, nav, nil];


                [controllers addObject:split];
            }
            tabNum++;
问题回答

Try:

PresetController *detail = [split.viewControllers lastObject];

指数0的观察控制器将是你的“主子”控制器,我假定“精细”控制器是你试图更新的表格。

Edit:

您不必在表格中使用<条码> 用户电报/代码>;该代码应为<条码>。





相关问题
List Contents of Directory in a UITableView

I am trying to list the contents of Ringtones directory in a TableView, however, I am only getting the last file in the directory in ALL cells, instead of file per cell. This is my code: - (...

iPhone NSUserDefaults persistance difficulty

In my app i have a bunch of data i store in the NSUserdefaults. This information consists of an NSObject (Object1) with NSStrings and NSNumbers and also 2 instances of yet another object (Object2). ...

Writing a masked image to disk as a PNG file

Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...

Resize UIImage with aspect ratio?

I m using this code to resize an image on the iPhone: CGRect screenRect = CGRectMake(0, 0, 320.0, 480.0); UIGraphicsBeginImageContext(screenRect.size); [value drawInRect:screenRect blendMode:...

Allowing interaction with a UIView under another UIView

Is there a simple way of allowing interaction with a button in a UIView that lies under another UIView - where there are no actual objects from the top UIView on top of the button? For instance, ...

热门标签