This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Chan Vysnow wrote:
I've try to show a tableview on a existent view that has already have two labels and toolbar on it. And I can delete a line in tableview. But it failed everytime.
I just wonder how could I do to make it. My view is not based on a navigation. Could somebody give me an example?
Thanks in advance!
You have to treat it like it was another UI object, like a UILabel. And have an IBOutlet in your ViewController to hook it up. Usually when there is a TableView it is connected to a UITableViewController. The problem with that approach is that the table takes up the entire UI bounds/frame.
I Hope that helps a little bit. It is a little tricky to find material on this, since all the books assume the table is taking up the entire view with a nav controller with it, but sometimes you don't want that.
IBOutlet UITableView *tableView;
remember @property and to @synthesize and release it.