• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to get a DOMRange
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >How to get a DOMRange (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: How to get a DOMRange (From: "Shawn Erickson" <email@hidden>)

  • Prev by Date: Re: DashBoard Help
  • Next by Date: flavour outerHTML
  • Previous by thread: Re: How to get a DOMRange
  • Next by thread: Notifying when a key is pressed and perform default tasks.
  • Index(es):
    • Date
    • Thread