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

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

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

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.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 10-12-2010, 03:38 PM   #1 (permalink)
Nerd.
 
Join Date: Jun 2010
Location: In a house
Posts: 458
BillyGiggles is on a distinguished road
Default Web browser question

Ok im making a web browser and i noticed when you type in teh website you have to put the http://www. in there..

How would i make it where you dont have to type in the http://www.

If you need the code im using just ask and i will post it...

Thanks
__________________
_______________________________________________
Thanks for the help!
BillyGiggles is offline   Reply With Quote
Old 10-12-2010, 04:05 PM   #2 (permalink)
Senior Member
iPhone Dev SDK Supporter
 
Join Date: Aug 2008
Location: Memphis, TN, USA
Age: 24
Posts: 3,983
smithdale87 is on a distinguished road
Send a message via AIM to smithdale87
Default

Whenever you click "Browse" or whatever button you'll use to load the URL, just check the web addres that the user entered. If it doesnt have the "http://www" then add it automagically
smithdale87 is offline   Reply With Quote
Old 10-12-2010, 04:23 PM   #3 (permalink)
Nerd.
 
Join Date: Jun 2010
Location: In a house
Posts: 458
BillyGiggles is on a distinguished road
Default

how would i go about doing this?
__________________
_______________________________________________
Thanks for the help!
BillyGiggles is offline   Reply With Quote
Old 10-12-2010, 05:33 PM   #4 (permalink)
Registered Member
 
Join Date: Jul 2010
Posts: 327
thomashw is on a distinguished road
Default

You could use regex. Take a look at regexkit.
thomashw is offline   Reply With Quote
Old 10-12-2010, 07:48 PM   #5 (permalink)
Nerd.
 
Join Date: Jun 2010
Location: In a house
Posts: 458
BillyGiggles is on a distinguished road
Default

ok will do
__________________
_______________________________________________
Thanks for the help!
BillyGiggles is offline   Reply With Quote
Old 10-12-2010, 08:29 PM   #6 (permalink)
Member to remember
 
Join Date: Jan 2010
Location: In the house!
Posts: 70
Sai Baba is on a distinguished road
Send a message via MSN to Sai Baba Send a message via Skype™ to Sai Baba
Default

Not every site begins with http://www.
For exemple, if i type "mail.google.com" then http://www.mail.google.com - will not do! I really wanted just http://mail.google.com So adding http://www. prefix is basicaly a silly idea.
Sai Baba is offline   Reply With Quote
Old 10-13-2010, 01:55 PM   #7 (permalink)
Nerd.
 
Join Date: Jun 2010
Location: In a house
Posts: 458
BillyGiggles is on a distinguished road
Default

Great point! So how do I not make it add the beginning.. Like in mail you van just type Apple.com and it will take you there instead of having to type http;//www.apple.com
__________________
_______________________________________________
Thanks for the help!
BillyGiggles is offline   Reply With Quote
Old 10-21-2010, 12:31 PM   #8 (permalink)
Member to remember
 
Join Date: Jan 2010
Location: In the house!
Posts: 70
Sai Baba is on a distinguished road
Send a message via MSN to Sai Baba Send a message via Skype™ to Sai Baba
Default

you could try adding only "http://" it should work. every decent site works both ways - with or without "www" i prefer links without www - its shorter.

in case of failure you can do a second try with www also included.
Sai Baba is offline   Reply With Quote
Old 10-21-2010, 09:17 PM   #9 (permalink)
Nerd.
 
Join Date: Jun 2010
Location: In a house
Posts: 458
BillyGiggles is on a distinguished road
Default

Ya but how do i make it even add http:// ?
__________________
_______________________________________________
Thanks for the help!
BillyGiggles is offline   Reply With Quote
Old 10-21-2010, 09:48 PM   #10 (permalink)
Registered Member
 
Join Date: Aug 2009
Location: Tasmania, Australia
Posts: 195
Son of a Beach is on a distinguished road
Default

Quote:
Originally Posted by BillyGiggles View Post
Ya but how do i make it even add http:// ?
There's a few ways. Here's one way:

Code:
NSString *newString = [NSString stringWithFormat:@"http://%@", oldString];
Son of a Beach is offline   Reply With Quote
Reply

Bookmarks

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: 350
8 members and 342 guests
Desert Diva, dre, freewind, hain, HemiMG, lendo, mottdog, oceanlablight
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,657
Threads: 94,118
Posts: 402,895
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jenniead38
Powered by vBadvanced CMPS v3.1.0

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