Re: How to get a DOMRange
Re: How to get a DOMRange
- Subject: Re: How to get a DOMRange
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Tue, 21 Aug 2007 09:27:28 +0200
On 21 Aug 2007, at 02:33, Shawn Erickson wrote:
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.
Many, many thanks! Works perfectly!
And without your help I would't have found the solution in a million
years.
Kind regards,
Gerriet.
_______________________________________________
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