Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I suppose all you need/want from the selected (user tapped) table view cell is device name came from your mutable array named 'device'</p> <p>If 'populating' means to let the newly loaded view controller, the destination view controller of 'TableDetails' segue, know the device name, </p> <ul> <li>Pass device name to sender: argument of performSegueWithIdentifier:sender: </li> <li>Device name could come from cell.textLabel.text or [device objectAtIndex:indexPath.row], as you've already done in a different method</li> <li>Let's say the name of the newly loaded view controller has a class name <strong>DeviceDetailViewController</strong>, for example</li> <li><p>Add @property (nonatomic, strong) NSString *deviceName; to <strong>DeviceDetailViewController</strong></p></li> <li><p>Override -prepareForSegue:sender: method of the view controller performing the segue and pass the device name comes as sender argument to the destination view controller of the segue in this way:</p></li> <li><p>destinationViewController @property has the newly loaded instance of DeviceDetailViewController by Storyboard if you have configured it properly in Storyboard design such as giving a new class name to the segue destination view controller</p></li> <li>setDeviceName: method is magically available by declaration of @property (...) deviceName; declaration if you are using the latest version of Xcode</li> </ul> <p><strong>DeviceDetailViewController</strong></p> <pre><code>@interface DeviceDetailViewController : UITableViewController @property (nonatomic, strong) NSString *deviceName; @end </code></pre> <p><strong>TableView</strong></p> <pre><code>- (void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if ([segue.identifier isEqualToString:@"TableDetails"]) { [segue.destinationViewController setDeviceName:(NSString *)sender]; } } -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { // UITableViewCell *cell=[tableView cellForRowAtIndexPath:indexPath]; [self performSegueWithIdentifier:@"TableDetails" sender:[device objectAtIndex:indexPath.row]]; } </code></pre> <p>Now you can do whatever you want with deviceName @property of DeviceDetailViewController in the class implementation.</p>
    singulars
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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