Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-12625

iOS: TableView.updateSection argument order is wrong

    Details

      Description

      The TableView updateSection method on iOS has the arguments in the wrong order. Unlike the other platforms (and updateRow), it expects the first argument to be a section object and the second argument to be an index.

      The following code runs on Android and Mobile Web, but fails on iOS.

      var win = Ti.UI.createWindow({
      	backgroundColor : "#eee"
      });
      win.open();
       
      var section = Ti.UI.createTableViewSection({
      	headerView : (function() {
      		var view = Ti.UI.createView();
      		var label = Ti.UI.createLabel({
      			text : "Some Section"
      		});
      		view.add(label);
       
      		return view;
      	})()
      });
       
      var row = Ti.UI.createTableViewRow({
      	title : "Row"
      });
       
      section.add(row);
      var section2 = Ti.UI.createTableViewSection({
      	headerView : (function() {
      		var view = Ti.UI.createView();
      		var label = Ti.UI.createLabel({
      			text : "Different Section"
      		});
      		view.add(label);
       
      		return view;
      	})()
      });
       
      var row2 = Ti.UI.createTableViewRow({
      	title : "Row 2"
      });
       
      section2.add(row2);
      var table = Ti.UI.createTableView({
      	data: [ section ]
      });
       
      table.updateSection(0, section2);
       
      table.addEventListener("click", function(event) {
      	alert("TableView Clicked");
      	Ti.API.debug(event.row);
      });
       
      win.add(table);
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                penrique Pedro Enrique (Inactive)
                Reporter:
                aevans Arthur Evans
                Reviewer:
                Vishal Duggal (Inactive)
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-15572
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Source Code