File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes iOS and the fly likes To show an UITableView on an UIView Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Mobile » iOS
Bookmark "To show an UITableView on an UIView" Watch "To show an UITableView on an UIView" New topic
Author

To show an UITableView on an UIView

Chan Vysnow
Greenhorn

Joined: Dec 22, 2009
Posts: 6

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

Joined: Feb 05, 2001
Posts: 17250
    
    6

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


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
GeeCON Prague 2014
 
subject: To show an UITableView on an UIView