开发者

How to use Webview's Identifier which's set in IB's Attribute inspector?

开发者 https://www.devze.com 2023-03-03 12:34 出处:网络
Here is a screenshot from the attribute insp开发者_如何学Cector: The identifier field in Interface Builder is equivalent to -[WebView setPreferencesIdentifier:]. This identifier is stored in the defa

Here is a screenshot from the attribute insp开发者_如何学Cector:

How to use Webview's Identifier which's set in IB's Attribute inspector?


The identifier field in Interface Builder is equivalent to -[WebView setPreferencesIdentifier:]. This identifier is stored in the defaults database and refers to a set of preferences that can be shared amongst different WebView objects. From the documentation:

The unique identifier for the preferences—it is fixed to the keys used to store the receiver’s preferences in the user defaults database. WebView objects can share instances of the WebPreferences class by using the same preferences identifier.

This method sets the receiver’s preferences to the specified preferences object if it exists. Otherwise, this method creates a new WebPreferences object for the receiver initialized with anIdentifier. Use this method to change the preferences used by the receiver’s WebFrameView objects. If you do not directly set the preferences, WebFrameView objects use the preferences returned by the standardPreferences class method of WebPreferences.

If you want to reference a WebView object in code, the most common options are setting an IBOutlet or using tag.

0

精彩评论

暂无评论...
验证码 换一张
取 消