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 02-28-2010, 09:33 PM   #1 (permalink)
Registered Member
 
Join Date: Feb 2010
Posts: 2
Default Webview and buttons

I have a tab bar application that shows a webpage in each. The problem is that if the user clicks links they can't get back to the main page. Could there be a button to take them to a specific URL? If so, how?
wraithstk is offline   Reply With Quote
Old 02-28-2010, 09:40 PM   #2 (permalink)
Registered Member
 
Join Date: Dec 2008
Posts: 31
Default

Add a button to the interface, and when that button is pressed just use:

[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.example.com"]]];

Working from the end, backwards, this uses a string ("http://www.example.com") to create an NSURL, which is then used to create an NSURLConnection, which the webView then loads
__________________

Last edited by lepetitapps; 02-28-2010 at 09:46 PM.
lepetitapps is offline   Reply With Quote
Old 03-08-2010, 06:53 PM   #3 (permalink)
Registered Member
 
Join Date: Feb 2010
Posts: 2
Default Getting button input

Quote:
Originally Posted by lepetitapps View Post
Add a button to the interface, and when that button is pressed just use:

[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.example.com"]]];

Working from the end, backwards, this uses a string ("http://www.example.com") to create an NSURL, which is then used to create an NSURLConnection, which the webView then loads
Thank you - but how do I check that the button is pressed? (I am very new to Objective-C)

Last edited by wraithstk; 03-08-2010 at 08:02 PM.
wraithstk is offline   Reply With Quote
Old 03-09-2010, 09:05 AM   #4 (permalink)
Registered Member
 
Join Date: Dec 2008
Posts: 31
Default

I'd probably recommend checking out iTunes U for the stanford podcasts as well as maybe getting a book on Objective C, but in the mean time I put together a quick tutorial for you here: Beginners Guides: Connecting Your Interface to Your Code | LePetit Apps
__________________
lepetitapps is offline   Reply With Quote
Reply

Bookmarks

Tags
button, webview

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: 251
23 members and 228 guests
@sandris, ADY, Dani77, diyora, FAED, fredidf, F_Bryant, GHuebner, HDshot, JasonR, mer10, Oral B, prchn4christ, Rudy, smithdale87, Speed, spiderguy84, stekki, tgjorgoski, Thompson22, Touchmint, twerner, vigu360
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,880
Threads: 89,228
Posts: 380,752
Top Poster: BrianSlick (7,129)
Welcome to our newest member, @sandris
Powered by vBadvanced CMPS v3.1.0

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