if rss feed has only one item how to go straight to its detail view without using a table - iphone

I have an rss feed with only one item in it.I am trying to go straight to showing its details without having to go through a table view to do it.
I have a different rss feed working in my app that has multiple items. I have this working with a table view.I was looking online and all I could find was how to display a feed through a table view.
Does anyone know how to display the singular item from the feed in an app?
or of any online tutorials?
Any and all help much appreciated.

Just parse the feed and insted of showing in tableview ,show it in a label or textview .

I don't understand what u trying to ask through your question. It sounds simple but can you elaborate or give url of Rss feed links for understaning ur query...

If you've parsed your data already, you have it stored in a set of variables, right?
So now you just want a particular data to display in detail view for this if you use (UIWebView for DetailView) used this or a particular you wish to publish in the details view:-
– loadHTMLString:baseURL:
Sets the main page content and base URL.
- (void)loadHTMLString:(NSString *)string baseURL:(NSURL *)baseURL
Parameters
string
The content for the main page.
baseURL
The base URL for the content.
k...

Related

UITableView Add Rows At The Bottom Using Parsing Another Page

I am working on an example project for learning purposes. I have successfully parsed a wordpress site by parsing RSS feed using NSXMLParser. The custom cell includes thumbnail, title, author and published date of posts.
Currently its showing the first page of feed containing 10 posts. I can access the second page of the feed http://sitename.com/feed/?paged=2 and and third page by putting /?paged=3, if i type them in the browser.
What i want to do is when user scrolls down to the bottom, it uses the second page feed url and show the posts at the bottom and so on. Can anyone guide me how to accomplish this task.
Coneybeare has the right idea on how to set it up.
Use AFNetworking, it'll make your life way easier.
I would have an int counter that keeps track of which URL has been last called. Then, as soon as the user gets to the bottom most cell (which you know via a delegate method), I would increase the int by 1, and then append that to the String that represents the URL. You can use the stringByAppendingString method for that.
Now you have a new String with the correct url, and you can fire off a new request, and append the data to what you already have. Then you can do [self.tableView reloadData] to refresh the table.
To make an infinite scroller, you need to know when to start fetching the new items. There are many ways to do this, but the best place is to hook into the UITableViewDelegate's methods. When cellForRowAtIndexPath: is called, check if the row is the last in your data store. If it is, make the call for the new data, then append it to the old data and refresh your view. You can also hook into the table views scroller to see when it it X percent scrolled to the bottom to make this call.

Text Only Detail View From RSS Parser

I'm new with the objective-c programming, but so far i manage to do a custom splitview which parse an rss link of news list in tableview on the rootview. When the link selected it will open the url in detailed view.The problem is i can only show the full html in uiwebview. What i want is that the detail view to display only text and the image (just like the BBC-News app), I tried the stringWithContentsOfURL and stripped the html tag, but it display the whole string from head to footer. I just wanted the body content. Is there anyway i can achieve that? Thanks in advance.
If you use the XMLParser then you should apply didStartElement method use this method and make a check for what ever part you want with simple syntax
if([elementName isEqualToString:#"body"])
use this type of if/else check to refine what ever that you want and save in an array according to your data Class then when you retrive data at the time of detail view use this array and tie with particular data whatever you want to show in your details view.
Like:-
label.text = array.title;
Hope this will help you...

How to push a view from a web page?

Suppose my app will load a local web page which is stored in my app bundle. I want to push the view or present a view when the user click a link or an image inside that web page. How to do this? Let's make this be general question: how to communicate with my app from a local web page?
Thank you.
Use "webview.request.URL.absoluteString" to get the request-string of the clicked link in the delegate-method "webViewDidFinishLoad:" or "webViewDidStartLoad:".
then you can scan this url for some special substring.
For example you could make a link like ".../index.php?iPhone_action=abcdef".
In the delegate-methods you can check if the link has the substring "?iPhone_action=" and if it does, then put the part of the link, whick follows "?iPhone_action=" in a NSString.
(in our example it would be "abcdef").
Depending on the value of this NSString you could fire a action in your app.
There is an undocumented method to catch the event when you click on a link in UIWebView. You can do whatever you want to do in that method.Search on google/stackoverflow for it. Or see my answer in this stackoverflow post.
Show alert view when click on a link

html code appears in my text view in RSS feed app

i got an rss feed app. All is working ok apart from the fact that in my "description" textView
(detail of the rss) the text appears in html!
any ideas in what is going on?
thanks!
i have found the solution using a wbview with loadHTMLString.
however i would like to ask what is the difference between these two rss feeds:
http://newsrss.bbc.co.uk/rss/sportonline_world_edition/front_page/rss.xml
and this for example:
http://feeds.feedburner.com/pitsirikos/uPfN
in the first one i can get the textview to display the contents as they should appear while in the second one i get html code in the textview!
my code remains the same in both cases...
The key difference between them is that the latter contains prefix tags
e.g. and
Do you use NSXMLParser or libxml2 ? are you doing a strcmp with the element name ?

iPhone Book Wrapper app, HTML pagination

i'm developing an app that will be just a wrapper for a certain book
the book is in HTML so, i want to make something like stanza,
i want to determine no. of pages given the Whole book HTML and to paginate that dynamically into views.
is there any built-in methods that can help me with that?
or
does anyone know any idea of how that can be done ?
If you only need to do this once: insert some javascript into the HTML to tell you the height of the document once it's done loading, e.g.:
alert(document.height);
and divide that by the height of your web view to get the number of pages.
You can use UIWebView to load the data, and leave the navigation/link code to paginate in the HTML.