iphone - How to display Two tables on a UI view -


i use , display 2 tables on ui view. please let me know how this. code same appreciated.

thanks, sandeep

  1. add 2 uitableviews view in ib , connect them 2 different outlets in file owner (or assign different tag properties).
  2. set delegate , data source them (may same view controller both).
  3. in delegate/data source methods following:

    -(nsinteger)tableview:(uitableview *)tableview numberofrowsinsection:(nsinteger)section{         if (tableview == myfirsttable)         // return value 1st table     if (tableview == mysecondtable)         // return value 2nd table      return 0; } 

or if use tag approach:

- (nsinteger)tableview:(uitableview *)tableview numberofrowsinsection:(nsinteger)section{        switch(tableview.tag){          case firsttag:             // return value 1st table          case secondtag:              // return value 2nd table     }     return 0; }  

Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -