using generated mobileweb content with my own iOS UIWebView

You must Login before you can answer or comment on any questions.

i have created a simple mobileweb app in titanium studio, which i can preview in my browser (which happens to be safari).... the app itself shows a stock "splash screen" from appcelerator, followed by the simple page i created....

i also have a simple ios6 app that contains a UIWebView, which i'm able to programmatically load with .html files.... after adding the package of files generated by titanium studio to my ios6 app, i find that when i load the 'index.html' file i only see the splash screen.... control never seems to move on to my own page....

any ideas what i'm missing here???

thanks....

— asked 7 months ago by bob frankel
2 Comments
  • i bob.. put some code snippet to understand the problem better...

    — commented 7 months ago by Ashish Nigam

  • here is the essence of my iOS app, which simply loads the index.html generated within titanium studio... the app works just fine with simple .html files i created myself....


    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    UIWebView* webView = [[UIWebView alloc] initWithFrame:self.window.bounds];
    [self.window addSubview:webView];
    
    NSString* htmlPath = [[NSBundle mainBundle] pathForResource:@"mobile-web/index" ofType:@"html"];
    NSString* appHtml = [NSString stringWithContentsOfFile:htmlPath encoding:NSUTF8StringEncoding error:nil];
    [webView loadHTMLString:appHtml baseURL:nil];
    

    [self.window makeKeyAndVisible];

    — commented 7 months ago by bob frankel

2 Answers

I know that Titanium Mobile Web has issues loading the index.html when it's dropped into the browser using the file:// URL. In fact, it doesn't work with any protocol other than http and https. When you load the index.html into a WebView, I'm guessing Titanium iOS will use some sort of file:// or app:// protocol that breaks the Titanium Mobile Web app. This same issue is causing issues for other developers. We will be fixing it as soon as we can.

Hi bob.. i think you mixing both the native app and titanium app... am i correct.. if so then this won't work.

Your Answer

Think you can help? Login to answer this question!