开发者

displaying web pages over web views in collection view using cocoa bindings

开发者 https://www.devze.com 2023-01-02 13:10 出处:网络
I tried sample example given at this link - Collection View Programming Guide It is simple and it worked. Considering it as a reference I tried a simple application which will show a collection view

I tried sample example given at this link - Collection View Programming Guide

It is simple and it worked. Considering it as a reference I tried a simple application which will show a collection view of web views with some web page displayed over each web view.

The model class has two properties: NSString *pageName, and NSURL *开发者_C百科pageURL.

I then followed each and every step written in tutorial above with required modifications but I was caught in the step -

How to bind web view to collection view item?

In binding tab it shows three possibilities : Editable, Hidden, Tool tip but none of these is working.

Can anyone suggest me way to accomplish my requirement?

Thanks,

Miraaj


WebView does not expose bindings for the URL (one would think it would, but it doesn't). You'll need to make use of NSCollectionViewItem (create a custom subclass) and update your WebView's URL when its represented object is changed.

The quick start guide you referenced does not show how to use a custom collection view item (it shows a very basic case). You'll need to delve a little deeper into the documentation (and online examples) to achieve your goal.

I would offer one thought to consider regarding your overall goal: WebView is a "heavy" object, so keep your performance expectations realistic regarding creating many of these views.

0

精彩评论

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

关注公众号