How To Add A Basic Webview To A App

This tutorial is for the people who want to develop an application that can open a website. This tutorial will take you step by step to create a very simple application which can open one URL. App’s objects-a navigation bar,a back,and a refresh. This tutorial has been tested on iPhone firmware’s 2.2 to 3.1 if 2.2 and under work please comment. Also we are going to be using the delegate method for loading our web page

If you have any questions, comment below. Good luck and enjoy!

Create Project:

1) Open XCode.

2) File -> New Project…

3) Select Application from left panel under iPhone OS as specified in the picture below.

4) Select View-Based-Application from right pane as specified in the picture below.

5) Click Choose…

6) File Dialog will open as specified in picture below. Select your location and enter project name as MobileYahoo in the text box in front of Save As.

7) Click Save. The project is ready to start work on it.

m yahoo

8) Expand your classes and resources folder, once your project has been saved

9) Then double-click on MainWindow.xib and wait for interface builder to show up

10) In your library drag a view onto the app then a navigation bar FIRST (before the webview), then a webview and double click on the navigation bar and change the name to Mobile Yahoo! Test (I’m naming it Test so I don’t get in trouble by Yahoo!)

11) Add two bar button items

tst

12) Click on the first bar button and under inspector (tools-inspector in the Interface Builder menu) click on the first tab (attributes) and under identifier scroll until you find refresh select that

13) Click on the bar button to the right, under attributes, title-type in “Back” (without the “”) so far the app should look something like this

tst1

14) In your document (Interface Builder menu-window-Document) click on MobileYahoo App Delegate then under Inspector click on the first tab identity (first on the right with a i button)

15) Follow the video until the next steps…

PART 1

You need to a flashplayer enabled browser to view this YouTube video

PART 2

You need to a flashplayer enabled browser to view this YouTube video

Comment if you need help and rate if you enjoyed this video

Related Posts

  • How To Switch Views using Multiple Viewcontrollers (Method 1)


  • 7 Responses

    11.17.09

    Thanks, I’ve been looking for this for a long time- great video

    Thanks,
    James

    11.17.09

    Thanks for tutorial.

    WebView like like any browser needs a ‘back button’ agreed, but unlike a regular browser the ‘back button’ shown here looks active right from launch.

    How would you approach either graying out or hiding the back button until the view actually ‘cangoback’?

    Look forward to your answer
    UKUSER

    11.17.09

    Hello there, honestly this is a basic tutorial so if you wanted to do a custom webbrowser aim me or skype me both are shayancaneat

    Ok Thanks!

    11.17.09

    @ukuser I have figured out how to help you out on your problem… you need to create a custom button and then setup a timer and then some code…

    I will try to create this tutorial when I finish off some of the basic skills needed for the project like NSTimer. First I will make small tutorials on those and then with those skills I’ll create a guide on how to create a custom Web Browser like safari
    Ok! :)

    11.17.09

    You should definitely keep making these nice videos, I can’t wait for more

    11.17.09

    Hi I keep getting this error!

    4AppDelegate.m:21: warning: ‘NSURL’ may not respond to ‘+requestwithURL:’

    11.17.09

    I don’t think you did something right! Please email me your project (compress it) then send it
    spicysquirrel@gmail.com
    or shayansmind@gmail.com – I check this one more often

    Leave Your Response

    * Name, Email, Comment are Required
    Subscribe via RSS

    Receive the latest iPhone app tutorials and resources delivered to you. Free.

    Latest Tweet



    Follow us on Twitter

    Write for Us

    Get your name in front of the masses by writing for iPhone App Tuts. We will share a plug about you and give links to your site and Twitter page.

    Write for Us

    We need your feedback

    Would you pay a small monthly subscription for consistent iPhone tutorials?

    View Results

    Loading ... Loading ...