Customise UITableView

How can I use more than one UITableView in one ViewController? Is it possible to ause more than one TableView in a page?

Actually i am creating a Application Form, there i have to use objects alternative for combo box.

I choose TableView instead for combo box.

Is this a right method?

Answers


Yes you can have more than one tableview in a UIViewcontroller . You need set tag for each tableview and with respect to you can load data in the tableview .

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {    
  if(tableview.tag == 1)
 {


 } else if (tableview.tag == 2)
 {

 } 

}

Definitely Goku, you can use multiple UITableViews in a single UIViewController. You just need to condition your both UITableView' in UITableViewDelegete. For example :

- (void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath {
        if (tableView == yourFirstTableView) {
            // <do whatever on first table view>...
        } else if (tableView == yourSecondTableView) {
            // <do whatever on second table view>...
        }
    }  

Just make sure you set the both delegates for both tables :

yourFirstTableView.delegate  = self;
yourSecondTableView.delegate = self;  

See this example in case of doubt.


Yes you can use more than one UITableView's in a single ViewController. And you can create an application form with it using different sections and using various accessory types .


You can use more than one table view in one controller, just define a different delegate for each UITableView instance. You can define new classes specifically to act as table view delegates, and have your controller create instances of these and set each UITableView's delegate property accordingly.


Yes For Sure you can use more than one tableview in single view controller. Simply Create tableview in xib or manually.

And in methods of Tableview you can write like this

-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    if(tableview==table1){

    }else if (tableview ==table2){

    }
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    if(tableview==table1){

    }else if (tableview ==table2){

    } 
}

Need Your Help

Update html table with jQuery for Modal Binding support in ASP.NET MVC

jquery asp.net-mvc

Right now, users click a button with JQuery. It dynamically adds a new form everytime. I need a way in JQuery or C# that can update the index so that is has the following format. The html is being

Nee Help In Understanding! PHP Functions

php function

I'm new to php, and cannot understand the logic below.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.