【发布时间】:2014-10-05 06:42:16
【问题描述】:
应用程序
我有一个包含菜单(表格)的 iOS 应用程序。从菜单中,用户被发送到两个 webView 中显示的相关本地 html 文件。我有兴趣将导航栏的标题设置为 html 文件的名称。
到目前为止
使用
- (void) prepareForSegue: (UIStoryboardSegue *) segue sender: (id) sender
{
if ([segue.identifier isEqualToString:@"showWeb"]) {
// NSString *myLabel = rowText ;
ViewController *detailsTVC = [segue destinationViewController];
detailsTVC.label = rowText; //rowText;
}
if ( [segue isKindOfClass: [SWRevealViewControllerSegue class]] ) {
SWRevealViewControllerSegue *swSegue = (SWRevealViewControllerSegue*) segue;
swSegue.performBlock = ^(SWRevealViewControllerSegue* rvc_segue, UIViewController* svc, UIViewController* dvc) {
UINavigationController* navController = (UINavigationController*)self.revealViewController.frontViewController;
[navController setViewControllers: @[dvc] animated: NO ];
[self.revealViewController setFrontViewPosition: FrontViewPositionLeft animated: YES];
};
}
}
当用户在菜单中选择一个项目时,这非常有效。
问题
但是,问题是我在html文件中有链接,链接到其他本地html文件,当用户按下链接时,标题当然不会改变。
基本问题是,我如何捕获/存储包含显示 html 信息的变量?
它不能通过表,因为它不会捕获通过链接的重定向。
【问题讨论】:
标签: html ios variables uinavigationbar title