[TIP] UIWebView

1 view
Skip to first unread message

Jesús Mazcuñán

unread,
Dec 4, 2010, 3:27:13 PM12/4/10
to ios...@googlegroups.com
Sobre la carga de páginas web de manera local...

Para cargar una web cuyo archivo HTML y sus contenidos referenciados (en la misma URL) están en la carpeta de recursos...

    

webView1 = [[UIWebView alloc] initWithFrame:CGRectMake(60, 10, 200, 200)];

[self.window addSubview:webView1];

NSString * path = [[NSBundle mainBundle] bundlePath];

NSString * filePath = [path stringByAppendingFormat:@"/index.html"];

NSURL * fileURL = [NSURL fileURLWithPath:filePath];

[webView1 loadRequest:[NSURLRequest requestWithURL:fileURL]];


Y si lo que cargamos es el HTML como cadena y sus contenidos referenciados (en la misma URL) están en la carpeta de recursos...


webView2 = [[UIWebView allocinitWithFrame:CGRectMake(60210200200)];

[self.window addSubview:webView2];

NSString * path = [[NSBundle mainBundlebundlePath];

NSString * html = @"<img src=\"imagen.png\"/>";

[webView2 loadHTMLString:html baseURL:[NSURL fileURLWithPath:path]];


Adjunto proyecto de prueba.

--
"Tengo artículos prohibidos de lugares
en los que el hombre no osa aventurarse.
También tengo yogur helado,
al que llamo Yogurlado."

http://www.mazcunan.net/
WebViewUnleashed.zip

Javier Campos (PSMoviles)

unread,
Dec 7, 2010, 4:23:06 AM12/7/10
to ios...@googlegroups.com

Hola Jesus,

 

 una pregunta,  si yo tengo una cuenta de administrador y necesito dar de alta a dos iphone que no tengo físicamente para puedan correr un desarrollo realizado

 

como puedo hacerlo?

 

 

Gracias.

 

 

Jesús Mazcuñán

unread,
Dec 7, 2010, 5:51:28 AM12/7/10
to ios...@googlegroups.com
Te contesto en otro hilo...

Reply all
Reply to author
Forward
0 new messages