Note that there are some explanatory texts on larger screens.

plurals
  1. POAdding a separate identifier to a second dynamic cell in ios 6?
    primarykey
    data
    text
    <p>The first scene of the project is a dynamic cell view, as shown below. I have given this an identifier so I can refernce it in the code.</p> <p><img src="https://i.stack.imgur.com/ZhhTm.png" alt="dynamic cells"></p> <p>I have created a second grouped section from within the code which displays as expected. When a user clicks on the first cell it moves to one particular scene, however the second cell also goes to the same scene.</p> <p>How can I give the second cell a separate identifier so I can then create a segue to a different scene? The second cell doesn't appear in the Storyboard so I can't give it one that way.</p> <p>The code I have for this scene at the moment is below:</p> <pre><code>#import "ViewController.h" @interface ViewController () @end @implementation ViewController @synthesize testLocation; - (void)viewDidLoad { testLocation = @"Washington, Dulles"; [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. } #pragma mark - Table View Methods - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView; // Default is 1 if not implemented { return 2; } - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section; // fixed font style. use custom view (UILabel) if you want something different { if (section == 0) { return @"Choose Test Location:"; } else { return @"Choose Test Type:"; } } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section; { if (section == 0) { return 1; } else { return 1; } } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath; { UITableViewCell *serverLocCell = [tableView dequeueReusableCellWithIdentifier:@"serverLocation"]; switch (indexPath.section) { case 0: serverLocCell.textLabel.text = testLocation; serverLocCell.detailTextLabel.text = @"Change"; break; case 1: serverLocCell.textLabel.text = @"Speed Test"; serverLocCell.detailTextLabel.text = @"Change"; break; default: break; } return serverLocCell; } @end </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload