Mostrar vista alternativa en la parte superior de TableView cuando SearchBar no devuelve resultados

in my app I have a table view that is populated by a Search Bar (I mean, the search Bar is querying CoreData and the Table View is filled by the results).

Right now, when entering this part of the app, I have an empty Table View waiting for the user to input something in the search bar.

What I would like is to display an alternative view when the table has no results. I've googled a lot since yesterday and the only solution I found is this: A UITableView with an "empty" view

...but I cannot make it work. If someone has some hint, or can point me to some URL to study the solution, would be great and appreciated :)

Thx for your time guys

preguntado el 08 de noviembre de 11 a las 15:11

1 Respuestas

You can add the alternate view below your tableview. When there is no text in the search bar, make the tableview hidden so that the view below it shows through. When you have search results to display, make the alternative view hidden and make the tableview's hidden property to FALSE.

respondido 08 nov., 11:23

should I add this view in the UITabViewController class? - Hna. Richie

Sorry, I had to switch to work on another part of the app. I couldn't try any solution so far, I'll let you know if it works :) - Hna. Richie

Ok, I use you approach. The only difference is that instead of making the tableView hidden, I basically set the hidden property of the alternative view. Thx for your time! Vote up for you :) - Hna. Richie

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