Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

To show an UITableView on an UIView

 
Chan Vysnow
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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!
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

so

IBOutlet UITableView *tableView;

remember @property and to @synthesize and release it.

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic