Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 12-28-2009, 02:15 PM   #1 (permalink)
Registered Member
 
Join Date: Apr 2009
Posts: 18
Default UIwebView

Hi,
I'm using an action button to open a url to safari.
Quote:
fileURL = [NSURL URLWithString:string];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString: string]];
But this method makes the user to leave my app... So what is the best solution to open the url without leaving my app..

Thanks
bobby456 is offline   Reply With Quote
Old 12-28-2009, 02:20 PM   #2 (permalink)
Registered Member
 
Join Date: Feb 2009
Location: Belgium
Posts: 106
Default

You actually gave the solution yourself. Use a UIWebView and set the url to the one you want.
SkyTrix is offline   Reply With Quote
Old 12-28-2009, 02:52 PM   #3 (permalink)
Registered Member
 
Join Date: Apr 2009
Posts: 18
Default

ya true
Quote:
- (IBAction) video: (id)sender {

NSString *string = [webView stringByEvaluatingJavaScriptFromString:
@"document.body.innerHTML.substring(document.body. innerHTML.lastIndexOf('embed src=')+11, "];
fileURL = [NSURL URLWithString:string];
[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:string]]];
When I use that and I click on the action button I have a blank page when there is no embed video.
Not like ..

Quote:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString: string]];
When there was no embed video, the button didn't do anything.

So how to use [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:string]]] without having that blank page?
bobby456 is offline   Reply With Quote
Old 12-29-2009, 12:12 PM   #4 (permalink)
Registered Member
 
Join Date: Apr 2009
Posts: 18
Default

Any idea ?
bobby456 is offline   Reply With Quote
Reply

Bookmarks

Tags
uiwebview

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 282
21 members and 261 guests
2WeeksToGo, ADY, apatsufas, ckgni, dacapo, Dani77, Fritzer, ghost, HDshot, headkaze, jakerocheleau, joeallenpro, masc2279, mer10, mystic.purple, objch, Rudy, tathaastu, themathminister, timle8n1, Zool
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,878
Threads: 89,223
Posts: 380,731
Top Poster: BrianSlick (7,129)
Welcome to our newest member, olga2000
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 11:38 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0