• 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: Extract ID Value Into UILabel.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Extract ID Value Into UILabel.


  • Subject: Re: Extract ID Value Into UILabel.
  • From: Jens Alfke <email@hidden>
  • Date: Fri, 5 Feb 2010 08:52:52 -0800

On Feb 4, 2010, at 11:44 PM, Philip Juel Borges wrote:

> This code,  HTMLverseLabel.text = [webView stringByEvaluatingJavaScriptFromString:@"document.title"]; extracts the title of any HTML file that is loaded in the UIWebView into a UILabel . So title becomes a general pointer that is only defined once.

You can also do this by accessing the DOM API directly from Objective-C, starting from the frame's DOMDocument. (But I'm not sure whether that API is available on iPhone.)

> The code, document.getElementById('1:1').id, extracts the id value 1:1 wherever that value occurs in my HTML files. But I'd rather not want to write 100s methods to extract each id value. So I'm thinking that there must be a way, in Objective-C, that you assign the numbers of this code, document.getElementById('1:1').id, a general pointer. I've tried replacing the numbers with %@ or %d but that doesn't work.

If I understand correctly, all you need to do is call [NSString stringWithFormat:...] to generate the right JavaScript expression.

—Jens_______________________________________________

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: 
 >Extract ID Value Into UILabel. (From: Philip Juel Borges <email@hidden>)

  • Prev by Date: Re: Mixing TableView Bindings
  • Next by Date: Re: logic problem. adding sine wave pattern to dynamic float
  • Previous by thread: Extract ID Value Into UILabel.
  • Next by thread: Main menu missing in 10.5. There in 10.6
  • Index(es):
    • Date
    • Thread