How do I create a button to go to a web page

Hi all,

I am new to developing an Iphone application and have a question?

I want to create an image button and when the user touches the button it takes them to a web page to display our current sales.  

What is the best way to do this?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

tradomskiAuthor Commented:
Thank you for your help.

Hello Tom,

You have a couple options here.  One of them is to have an in-house Web View to view the website or to transfer to Safari to bring up the website.

Web View

You can create a UIWebView instance through Interface Builder or by add the sub-view.  

Here is a tutorial (or two) to create the UIWebView in your application:



You can simply switch to Safari instead of hosting the web-view yourself.  However, this will lead users away from your application and could be un-wanted.

Here is an example of loading Google through Safari.  Due note, this will only work on device as the Simulator does not have Safari.

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@""]];

Open in new window

If you have any other questions, please do not hesitate to ask.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
     The best is use WebView along with delegate -
- (void)webViewDidFinishLoad:(UIWebView *)webView

Add and activity indicator to your webview and hide it in the above delegate. It shows that process is going on. This delegate called when webview finshed loading the content of that URL

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Swift Programming

From novice to tech pro — start learning today.