how to use XML in Sdk for web base application? - iphone

I'm want to know how's correct way to use Xml in sdk for web base application
i'm trying to do magazine in iphone but they told me that i have to use XML to take body and other thing from that web site?
please some one direct me to that and if you have any tutorial for that
thanks

I think I know what you're talking about, but it may be off because your English is a little off.
I think you're trying to parse the HTML of a web page. The easy way to do this (assuming the web page is valid XHTML), is to use NSXMLParser. It's an event driven parser, so you provide a delegate and as the parser moves through the document it will send messages to your delegate. Watch to see if the opening element is a body tag, grab the string, then close the string when the closing body tag is found.
The Apple guide is here

Related

How to Delete nodes from HTML in iOS

What I am trying to do is to load a webpage into in a UIWebView. The problem is that I need to do some preprocessing on the html before displaying it in the web view.
The UIWebview loadHTMLString is quiet slow when the html is big. I don't need to display the full page therefore i am trying to remove some html nodes before displaying it in the web view to speed up the loading time.
I don't think using regex for that is a wise idea. I checked out NSXMLParser and TFHPPLE but I couldn't find any way to remove nodes from the html tree using an XPath or something.
I know I could do that using Javascript but that won't solve my problem. I also don't have no control on the website so I can't edit in the webpage itself.
Is there something as easy as deleteNodeUsingXPath or something :)
Cheers and thanks a lot for your help in advance.
One possibility solution: do a proxy website which strips out unwanted stuff. The iphone accesses the proxy website URL. The proxy website loads from the original website, strips out unwanted stuff, and replies with the remaining stuff.
There is a tool called Objective-C-HTML-Parser that will do what you are looking for. The documentation is thorough, and the implementation is pretty straight-forward.
Basically, you take your HTML string and make an HTMLParser object that you can then manipulate however you want. It is a very powerful library that basically lets you do whatever you want with HTML with easy-to-use Objective-C APIs.
Good luck!

Grabbing Text from a website using xcode

what i am aiming to do is make an app that grabs text from a website and auto updates when the text on the website changes, does anyone have any ideas or any solutions that could help?
I think you can use Javascript for taken text you need. Also you can use NSRegularExpressions (but it's worse variant). For autoupdating - you should be delegate of UIWebView and check your text in didFinished… method.
Do you mean an iPhone web app? If so do the following:
<head></head><body><?php include ("pathtocontent/content.php") ?></body>
And save as e.g. index.php
Put in the content.php file:
<p>content.</p>
Or anything else you want as content.
Then in the iPhone website do the same. Then you only have to update content.php in order to cjhange both the websites
Look at NSURLConnection, send a request to the website, the data will be in the response

Pushing news to my iOS app

What would be the easiest way to set up a way in which my iPhone app can read news data online from my website, for example. I want to be able to push news or updates to the bottom of the app such as "Check out our new app, blah blah" or something along those lines. I thought of one way, but I didn't know if there's better ways.
Keep some html file on my server (my website), and have the iPhone read that html data
Any other ideas? Anyone have experience in this field?
If you already have a blog or are familiar with some popular blogging software, you can likely take advantage of RSS feeds that are automatically generated for you.
For example, you can have Wordpress automatically generate RSS for a post type, a tag, a category, or pretty much anything else that returns a set of posts. Your application could then consume that data without you needing to manually update anything code-laden, just add to the blog and it's available in the feed.

How do I implement a Floodlight tag into an iPhone app?

A client is asking me to insert a Floodlight tag into an Objective-C programmed iPhone app that is ready for submission to the App Store.
I did some Googling, and couldn't find anything about how to do this (it seems like you can you only add Floodlight tags via Javascript, but I'm not too sure). Can you do this, and, if so, how?
If nothing else, you can create an offscreen UIWebView and invoke the appropriate javascript with stringByEvaluatingJavaScriptFromString. Not a good solution, but if javascript is required it may be your only choice.
Instead of embedding a UIWebView right off the bat for this, you could try using NSURLConnection to request the URL normally inserted with the Floodlight iframe. It seems that unless the contents of the iframe (which should just be a transparent GIF) need to interact with the host page, simply performing and receiving the request should fulfill the purposes of tracking. Check the ToS, though, to see if they have any stipulations about this.

Web search in an iPhone app

I've got experience in C/C++ and am trying to now learn Objective-C for iPhone development. I have very little web design experience.
I'm trying to create an app for a friend's site that accesses a search feature from a website and then display the results in a UITableView. For example, (this isn't the site I'll be using, but...) using the stackoverflow search function and then being able to format the results (https://stackoverflow.com/search?q=iphone+web+search) in cells. I'd like to leave out the rest of the content on the page.
I've only been able to find info about reading xml or rss search results. Otherwise, I could use UIWebView, but that displays the entire site. Are there other classes that I should look into for doing this? Any help would be very, very much appreciated!
The iPhone SDK doesn't include Cocoa libraries for parsing HTML. Just NSXMLParser, which isn't a good tool for what you want to do. (It will choke on valid HTML that isn't valid XML.)
This page is probably a good first place to look. The author says, "For scraping/reading a webpage, XPath is the best choice. It is faster and less memory intensive then NSXMLParser, and very concise. My experience with it has been positive."