Is it possible to create a static table view in ios5 without using a storyboard?

I don't want to use storyboard in my application, but static table views and custom table view cells are really handy. Can I use them in an app without a storyboard?

+3


source to share


1 answer


Some clarifications first. Static or dynamic and custom table views are not existing expressions and I am assuming that you are mixing storyboard with InterfaceBuilder, but I think I know what you mean.

  • You can do anything without a storyboard, except a storyboard. Just keep in mind that it won't work on devices with earlier versions of IOS than IOS5, or better said, you won't be able to deploy it.

  • The "static" tableview is a simple UITableViewController that you can define in the interface section of the .h file as follows:

    @interface MyListTableViewController : UITableViewController
    
          

It has a view that you can use as myListTableViewController.view. or attach any other view in your code or drag and drop a new one in XCode Interface Builder.



  • You can use any other controllers like

    @interface MyNotTableViewController : UIViewController 
    <UITableViewDelegate, UITableViewDataSource>
    
          

but you have to match that it works with tableview delegate and datasource delegate as you can see attached to the string with parentheses. From now on, you can use the same technique as before to attach more table views. If you size this screen in full screen or main view, you will get visually the same result as above in # 2.

0


source







All Articles