【问题标题】:How to display the content of an Objective-C array when html button gets clicked in UIWebview.在 UIWebview 中单击 html 按钮时如何显示 Objective-C 数组的内容。
【发布时间】:2011-08-31 08:59:38
【问题描述】:

我在 Objective-C 源代码中有一个数组。

我必须在 Html 或 Javascript 中单击按钮时显示数组的内容,如何在 xcode 中链接目标 C 中的 Html 文件。

【问题讨论】:

    标签: html objective-c xcode uiwebview


    【解决方案1】:

    可以使用uiwebview在objective-c中显示html内容

    在xib中创建一个webview并连接到IBoutlet UIWebView *web; 然后在任何你想要的地方编写这段代码。文件应该在资源文件夹中

     NSString *path1 = [[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"filename"] ofType:@"html"];   
       NSURL *url1 = [NSURL fileURLWithPath:path1];
       NSURLRequest *request1 = [NSURLRequest requestWithURL:url1];
       [web loadRequest:request1];
    

    【讨论】:

      猜你喜欢
      • 2018-08-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-03-27
      • 2017-02-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多