I need to have two Table Views in one XIB file, is there any way to do that?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Another cleaner way to do is to add two different UITableViewController to the XIB and set it to different classes.
Your XIB should look like this. Instead of connecting the table view datasource and delegates to File’s owner, you connect it to their own controllers.
This way, your code will be clean and easy to maintain. Later on if you want to move that table to a different view, it’s very easy and can be done just by changing IB.