开发者

How to display the content of an Objective-C array when html button gets clicked in UIWebview.

开发者 https://www.devze.com 2023-04-01 23:28 出处:网络
I have a array in the Objective-C source. I have to display the contents of array on onclick of a button in Html or Javascript, how to link the Html file in objective C in xc开发者_开发技巧ode.You ca

I have a array in the Objective-C source.

I have to display the contents of array on onclick of a button in Html or Javascript, how to link the Html file in objective C in xc开发者_开发技巧ode.


You can use the uiwebview to display the html content in objective-c

Create a webview in xib and connect it to IBoutlet UIWebView *web; Then write this code wherever you want.And the file should be in the resources folder

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

精彩评论

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

关注公众号