Re: How to get a DOMRange
Re: How to get a DOMRange
- Subject: Re: How to get a DOMRange
- From: "Shawn Erickson" <email@hidden>
- Date: Mon, 20 Aug 2007 17:33:44 -0700
On 8/20/07, Gerriet M. Denkmann <email@hidden> wrote:
> This looks nice but does not work:
>
> DOMRange *domRange = [ [ DOMRange alloc ] init ];
> [ domRange selectNode: someNode ];
> [ webView setSelectedDOMRange: domRange affinity:
> NSSelectionAffinityUpstream ];
>
> After the first line I get an exception: "+[DOMRange init]: should
> never be used".
> So: what to use instead? Which manuals to read?
I believe you should use -[DOMDocument createRange]... in other words
ask your [[webView mainFrame] DOMDocument] for a range that you can
use.
-Shawn
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden