uiwebview

UIWebView loading html5-Video EXC_BAD_ACCESS crash

若如初见. 提交于 2019-12-14 03:39:43
问题 in our iPad-App we are using an UIWebView to load different sites from one domain some of them with a hml5-Video. Sites without a Video do load perfectly. But when I'm loading a site containing htmlt5-video sometimes my app crashes during the loading-process of the UIWebView with EXC_BAD_ACCESS and sometimes it does not. Whenever such a crash occurs it seems to happen at the point where the Video-Player is added into the site. I did download the UICatalog-Example from Apple and just did

Use of undeclared identifier - Xcode

依然范特西╮ 提交于 2019-12-14 03:36:14
问题 I first created a property in my SecondViewController.h file using @property (weak, nonatomic) IBOutlet UIWebView *webView; And then synthesised it in the corresponding .m file using @property (weak, nonatomic) IBOutlet UIWebView *webView; I then created a function to create a webpage using a string which the user would cast as an argument. The function: void createWebpage(NSString *webString) { NSURL *url = [NSURL URLWithString:webString]; NSURLRequest *requestUrl = [NSURLRequest

iOS Orientation Issues

狂风中的少年 提交于 2019-12-14 03:04:35
问题 I have a simple web-application that im using native to build. My application consicts of MainWindow.xlb with is filled with Native View Controller. Within Native View Controller.m i have the following code: http://pastebin.com/xXFc0JCW Looked to messy to copy and paste in here. I cant seem to understand where i'm going wrong and why my application/ UIWebView always stays portrait. Im new to iOS development. Full source code: https://www.dropbox.com/s/i9woti5ptecr9n4/Native.zip 回答1: Now it

iPhone and UIWebView: Force HTTPS (rewrite URLs on the fly)

霸气de小男生 提交于 2019-12-14 02:22:48
问题 I have a web based application that uses Cocoa/CocoaTouch's UIWebView. I want (need?) to force all HTTP connections to HTTPS. Note that I am interested in forcing the initial, landing URL to HTTPS and all the intermediate fetches to HTTPS also. Motivation: New Tricks for Defeating SSL in Practice and sslstrip. Is it possible to configure WebView to only use HTTPS? The UIWebView documentation does not even mention HTTPS. Considering Apple does not allow me to disable JavaScript in a UIWebView,

UIWebView auto rotation corrupts web view content (screenshots inside)

我是研究僧i 提交于 2019-12-14 01:30:02
问题 i'm having a problem with UIWebView auto-rotating. the web view straches alright but the content is not. as you can see in the bottom screenshot there is a black margin, and i know it's the webview since i can see the scrollers when i scroll. the view controller has: - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return YES; } the webview has full auto resizing mask, and the view is auto-resizing subviews. i tried a bunch of tricks from

extract specific string in NSString

五迷三道 提交于 2019-12-14 00:42:01
问题 i think it is a simple question but i dont know how to solve it. i have a NSString that containes html content. i want to extract some tags. NSString *string=@"test some text <img src='http://www.xyz.com/a.jpg' > blah blah <a href='asdfg'>aaaa</a> bbbb cccc"; i want to take img & "a" tag into new string. then i will display it in UIWebView. how can i parse it? 回答1: The best way is to write a partial tag parser. This is not very difficult. Another option is to simply find the position of src='

XCode ios4 UIWebView Code Problem

我的梦境 提交于 2019-12-13 23:17:54
问题 -(void)viewDidLoad { [webView loadRequest:(NSURLRequest) requestWithURL:[NSURL URLWithString:@"http://itunes.apple.com/ca/album/zirka-live/id352921457"]];]; } 回答1: [webView loadRequest:(NSURLRequest) requestWithURL:[NSURL URLWithString:@"http://itunes.apple.com/..."]];]; should be [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://itunes.apple.com/..."]]]; that is (NSURLRequest) => [NSURLRequest ];]; => ]]; 来源: https://stackoverflow.com/questions/3305396/xcode

How to remove html tags and trim the characters to 250 in Objective C

核能气质少年 提交于 2019-12-13 21:35:43
问题 I am displaying html data in webView (lot of content).Now i want to remove all the tags and trim the content to only 250 charecters and display in my Web-view. Thanks In Advance.... 回答1: Included this function in the class. in .h - (NSString *)stringByStrippingHTML:(NSString *)inputString; in .m - (NSString *)stringByStrippingHTML:(NSString *)inputString { NSMutableString *outString; if (inputString) { outString = [[NSMutableString alloc] initWithString:inputString]; if ([inputString length]

Create dynamic checkbox in UIWebView

╄→гoц情女王★ 提交于 2019-12-13 21:12:23
问题 I am trying to create dynamic checkbox in UIWebView. I am using this code : NSMutableArray *array = [[NSMutableArray alloc]initWithObjects:@"Sudhaadagdudgdada",@"qwertyuiopo",@"asdfghjkl", nil]; for (int j = 0; j < array.count; j++) { NSString *html = [NSString stringWithFormat:@"<div id='check'></div><script> str=''; str += '<input type=\"checkbox\" name=\"one_'+i+'\" value=\"'+%@+'\" onclick=alert(this.value); />' document.getElementById(\"check\").innerHTML=str;</script>",[array

Loading resources from relative paths through NSURLProtocol subclass

拈花ヽ惹草 提交于 2019-12-13 17:58:41
问题 I have an NSURLProtocol registered for a UIWebView-based app, set up to respond to file scheme requests. In the web view, I load images, CSS, JS etc. and all that's all working fine; the problem comes when I try to reference an image in a CSS file that's not at the root directory of the HTML tree. E.g. <html> <head> <style type="text/css"> .1 { background-image: url("1.png"); } </style> <link href="css/style.css" rel="stylesheet" type="text/css" /> <!-- contents of css/style.css might be: .2