ios - two UITableViews inside one UIViewController -
i have 2 uitableviews (tableview , tableviewevent) on same controller. unfortunately, xcode not allowing me this. want below:
- (nsinteger)tableview:(uitableview *)table numberofrowsinsection:(nsinteger)section { if (uitableview == self.tablevie) {
xcode keeps wanting change code below, problem crashes on other tableview (tableviewevent). how this?
- (nsinteger)tableview:(uitableview *)table numberofrowsinsection:(nsinteger)section { if (tablevie == self.tablevie) {
lastly, tables not return cells (even though nslog shows data there). i'm using cellsatrowforindex:
- (uitableviewcell *)tableview:(uitableview *)tv cellforrowatindexpath:(nsindexpath *)indexpath { static nsstring *myidentifier = @"cell"; if ([uitableview isequal:self.tablevie]) {
it should be:
if (table == self.tablevie) {
to compare parameter instance variable. might want consider using container view controller approach , having separate controllers each of tables keep code clear , logic separate.
Comments
Post a Comment