Introduction to WebKit Objective-C Programming Guide
来源:互联网 发布:eve四种泰坦数据 编辑:程序博客网 时间:2024/05/17 01:46
Concurrency Note:
What Is the WebKit?
The WebKit provides a set of core classes to display web content in windows, and by default, implements features such as following links clicked by the user. The WebKit greatly simplifies the complicated process of loading webpages—that is, asynchronously requesting web content from an HTTP server over the network where the response may arrive incrementally, in random order, or partially due to network errors. The WebKit also simplifies the process of displaying content that can contain various MIME types, and multiple frames each with their own set of scrollbars.
You use the WebKit to display web content in a window of your application. It’s as simple as creating a view, placing it in a window, and sending a URL load request message. By default, your WebKit application behaves as you would expect without error. The WebKit conveniently creates and manages all the views needed to handle different MIME types. When the user clicks on a link in a page, the WebKit automatically creates the views needed to display the next page.
However, the WebKit doesn’t implement a complete set of web browser features. You can, however, extend the WebKit by implementing custom delegate, view, and model objects. For example, you can implement a delegate to display load status, and the current URL.
The WebKit also offers web content editing. If you enable editing in your WebView, users can edit the web content it displays. You can programmatically control the current selection and control editing behavior using a WebView delegate. You can also modify the Document Object Model directly using an Objective-C API.
You can also access JavaScript from Objective-C and vice versa.
Who Should Read This Document?
The WebKit Objective-C API is specifically designed for embedding web content in your Cocoa or Carbon applications—developing web client applications
Important:
Organization of This Document
The following articles cover key concepts in understanding how the WebKit works:
“Why Use the WebKit?”
describes the purpose of the WebKit and why you might want to use it in your applications. “Core WebKit Classes”
describes the core WebKit classes and the object-oriented design that is fundamental to understanding how the WebKit works.
The following articles explain how to display web content in views:
“Simple Browsing”
shows how to embed web content in your application by following a few simple steps. “Multiple Windows”
shows how to add support for multiple windows, and open windows automatically. “Loading Pages”
shows how to track the progress of loading frame content. “Loading Resources”
shows how to track the progress of loading individual resources on a page. “Paging Back and Forward”
shows how to implement a back-forward list and add Back and Forward buttons to your application. “Managing History”
shows how to maintain a history of all the visited pages, and allow the user to go to a previously visited page. “Spoofing”
shows how to use user-agent strings. “Accessing the WebKit From Carbon Applications”
explains how to embed web content in Carbon applications. “Determining WebKit Availability”
explains how to determine if the WebKit is available on your system.
The following articles explain how to implement web content editing:
“Enabling Editing”
shows how to enable user editing in a WebView. “Saving and Loading Web Content”
shows how to save and load web content edited by the user. “Modifying the Current Selection”
shows how to programmatically modify the current selection. “Changing Editing Behavior”
explains how to use the WebView editing delegate to customize editing behavior. “Using Undo When Editing”
shows how to implement undo when editing web content.
The following articles explain how to use the Document Object Model Objective-C API:
“Using the Document Object Model from Objective-C”
describes the DOM Objective-C API in terms of the specification. “Using the Document Object Model Extensions”
describes the WebKit extensions to the DOM API.
Read this article if you want to access JavaScript from your application:
“Using JavaScript From Objective-C”
shows how to access the scripting environment from an Objective-C application.
You begin using the WebKit by first embedding web content in your application. Read
See Also
For more details on the Objective-C WebKit API, read:
WebKit Objective-C Framework Reference
WebKit Plug-In Programming Topics
WebKit DOM Programming Topics
There are other technologies, not covered in this topic, that can be used in conjunction with the WebKit or separately to solve related problems.
Refer to this document for more details on the URL loading system:
URL Loading System Programming Guide
If you are accessing the WebKit from a Carbon application, refer to these documents:
WebKit C Reference
Carbon-Cocoa Integration Guide
If you are creating web content for Safari or Dashboard, refer to these documents:
WebKit DOM Programming Topics
WebKit DOM Reference
Dashboard Tutorial
Dashboard Reference
The /Developer/Examples/WebKit
Other related text book resources are:
HTML and XHTML: The Definitive Guide
(O’Reilly) Cascading Style Sheets: The Definitive Guide
(O’Reilly) JavaScript: The Definitive Guide
(O’Reilly)
Also refer to the World Wide Web Consortium at
© 2003, 2009 Apple Inc. All Rights Reserved. (Last updated: 2009-07-28)
Shop the
- Mailing Lists
- RSS Feeds
Copyright © 2010 Apple Inc. All rights reserved.
- Terms of Use
- Privacy Policy
- Introduction to WebKit Objective-C Programming Guide
- Introduction to The Objective-C 2.0 Programming Language
- Objective-C Runtime Programming Guide
- Objective-C Runtime Programming Guide
- Introduction to Core Data Programming Guide
- Introduction to Stream Programming Guide for Cocoa
- Introduction to CFNetwork Programming Guide(译)
- Objective-C Runtime Programming Guide 中文翻译
- Objective-C Runtime Programming Guide 中文翻译
- Objective-C Runtime Programming Guide 笔记01
- 一、Framework 简介(Introduction to Framework Programming Guide)
- Introduction to Android Webkit
- An introduction to Objective-C Meta Class
- runtime系列1--Objective-C Runtime Programming Guide简介
- [译]Objective-C Runtime Programming Guide -Messaging (二)
- Objective-C语言--Key-Value Observing Programming Guide
- Objective-C Runtime Programming Guide 笔记02 objc_msgSend Function
- Introduction to MMX Programming
- 以往的寒暑假
- 【VC / MFC】二维坐标旋转
- asp.net中用label实现前台跳转并传值
- oracle 10g正则表达式 REGEXP_LIKE 用法
- tomcat
- Introduction to WebKit Objective-C Programming Guide
- 使用NBear设计一个新的实体类时需要进行的操作
- WebKit介绍——Objective-C编程指南
- .NET 网站优化---页面缓存收藏
- mysqldump命令行导出中文乱码解决
- HNOI2004 打砖块
- Linux-2.6.20的LCD驱动分析(三)
- Linux-2.6.20的cs8900驱动分析(一)
- PHP中GET和POST的区别