views:

225

answers:

2

Hi!

I have an UITableView and I want to populate it with data from this page: http://tvgids.mobi/gids/ned1.php I have this code:

 NSURL *urlll = [NSURL URLWithString:[NSString stringWithFormat:url]]; 
    NSString *test = [NSString stringWithContentsOfURL:urlll];
    UIAlertView *av = [[UIAlertView alloc] initWithTitle:@"LOL" message:test delegate:self cancelButtonTitle:@"Dismiss" otherButtonTitles:nil];
    [av show];
    [av release];

That part works, but the problem is: How do I get the list of tv programs into an UITableView? I can't use an XML parse since the page isn't valid XML. Every single tv program on that page is written like this (in html):

<div class="v2-listing"><div class="v2-tijd">13:30</div>
      <div class="v2-omschrijving"><a href="http://tvgids.mobi/vanavond-op-tv/8428198-NOS_Sportjournaal.xhtml" >NOS Sportjournaal</a></div>
    </div>

I need to get v2-tijd (e.g. 13:30), and the a's href (e.g. 'http://tvgids.mobi/vanavond-op-tv/8428198-NOS%5FSportjournaal.xhtml') and content (e.g. NOS Sportjournaal).

Is there a way to do this? Which way?

Thanks!

+1  A: 

I would probably try using RegExKit or RegExLite to grep out what I needed, but that's probably not the best way.

slf
A: 

Use UIWebView inside UITableViewCell.

itsaboutcode
Man come on. Read my question -_-
Time Machine
Well after reading your question i said you that. I have gone through this problem where i have to my web page data in TableView, so how i can do this? Forget about UITableView and put UIWebView as subview of UIView, its like making a Browser inside your app.
itsaboutcode
Nope, I don't do that. I completely follow the iPhone Interface Guidelines and I don't want to fake native controls.
Time Machine