iOS: UITableView horizontal dentro de otros problemas de UITableView

I want to create a table with horizontal scrolled rows. I have followed Felipe Laso's tutorial in Raywenderlich's blog, aquí. It works perfectly except for 2 issues.

First, the inner horizontal table should have a dynamic number of cells based on an array fetched asynchronously using ASIHTTPRequest block from the outer vertical table.

//Inner horizontal table number of rows
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
    //self.articles is being assigned from cell.articles asynchronously from the outer vertical table
    return [self.articles count];

The code above gives me an error, if the self.articles hasn't yet been assigned. So how could I determine the number of rows from the outer ASIHTTPRequest block and reload the inner table?

Second, I want to push another view based on each cell's horizontal and vertical indexes.

I have 2 didSelectRowAtIndexPath method in the 2 table, I tried to NSLog the indexpath.row at both tables, the inner table logged the cell's index, however the outer table logged NULL.

¿Entonces qué debo hacer?

preguntado el 03 de mayo de 12 a las 19:05

1 Respuestas

If you haven't read your data in yet, then you don't have any rows, you should return 0. When you have read in your data, then when the read is complete, call reloadData on the list to refresh all the calls. You probably want to push your second view at this time too.

contestado el 03 de mayo de 12 a las 20:05

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.