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
- add 2 uitableviews view in ib , connect them 2 different outlets in file owner (or assign different tag properties).
- set delegate , data source them (may same view controller both).
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
Post a Comment