Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8986987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:40:59+00:00 2026-06-15T21:40:59+00:00

I’m new to programming and I need to embed a website in my application

  • 0

I’m new to programming and I need to embed a website in my application (which is blank; I only want to embed the website right now). I’ve been searching for it since 5:00 PM (It’s now 9:30 PM) and I still didn’t find anything about that.

What code do I need and in what file I need to write it? What do I have to link together?

I use Xcode 4.5.1 and I’m trying to do a Cocoa application for Mac OS X (not for iOS).

I’m sorry if some of my sentences are not clear, but English is not my primary language.

If you need more information in order to help me, just ask.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T21:41:00+00:00Added an answer on June 15, 2026 at 9:41 pm

    In your AppDelegate.h file, add this line below the #import <Cocoa/Cocoa.h> line:

    #import <WebKit/WebKit.h>
    

    and add this line below the @property (assign) IBOutlet NSWindow *window; line:

    @property (assign) IBOutlet WebView *webView;
    

    Select your MainMenu.xib file.

    Open the window inside it, then drag a WebView from the Object Library browser into the window. Align and size it.

    There should be an icon representing your AppController object to the left of your UI layout. Control-drag from it to your WebView inside your window. (Do not control-drag from your File's Owner icon!) Release the mouse button. A contextual menu should appear, containing the word webView. Select it.

    Add the framework WebKit.framework to your project. Right-click on your Frameworks folder in the resource list on the left side of the Xcode window. Choose “Add files to “<your project name>”… and select the framework using this path: /System/Library/Frameworks/WebKit.framework.

    Select your AppDelegate.m file.

    In your -applicationDidFinishLaunching: method, replace the comment with this code:

    // I provided Apple's URL, but this is where you provide your own instead.
    NSURL *url = [NSURL URLWithString:@"http://www.apple.com"];
    NSURLRequest *urlRequest = [NSURLRequest requestWithURL:url];
    [[[self webView] mainFrame] loadRequest:urlRequest];
    

    Build and run. When the window appears, you should see it load the web page you described in the URL.

    A few final words:

    I see that you’re new here. What I’ve just done, in the context of Stack Overflow, is to give you a gift. You need to try a little harder looking for resources on the Web. I found two myself, but because they’re a bit old (and the development tools look different enough), I embarked upon this answer. I want you to promise that you’ll work harder to find answers for yourself. A great place to begin is by reading Apple’s own very excellent documentation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want use html5's new tag to play a wav file (currently only supported
I have a jquery bug and I've been looking for hours now, I can't
I used javascript for loading a picture on my website depending on which small
this is what i have right now Drawing an RSS feed into the php,
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I am trying to understand how to use SyndicationItem to display feed which is
I am using the SimpleRSS gem to parse a WordPress RSS feed. The only
I would like to run a str_replace or preg_replace which looks for certain words

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.