I have a small app that uses multiple section layouts for the initial table view. One section displays the most recent trends from Twitter and the other section displays the
There's not quite enough information in your question to be sure, but this sounds like an issue with what I'd call automatic versus manual segues and the restrictions on each.
An automatic segue is created in IB by dragging from a (prototype) table cell or other control. The nice thing about it is that it's, well, automatic -- tapping the control performs the segue, and all you need to do in your code is implement prepareForSegue:sender:
so that the destination view controller gets the right data. The downside is that any given control (including prototype table cells) can only have one outgoing segue (otherwise, the storyboard wouldn't know which to automatically perform).
A manual segue is created in IB by dragging from the source view controller. The upside to this is that a view controller can have multiple outgoing segues. On the other hand, they aren't associated with a tappable control, so you have to implement logic that determines which to perform when (and calls performSegueWithIdentifier:
to make it happen).
Given those tradeoffs, there are two possible solutions to your problem:
Use multiple prototype table cells -- then each can have its own outgoing automatic segue. You'll need to change your table view controller's tableView:cellForRowAtIndexPath:
to check the index path's section number and choose the appropriate identifier for dequeueReusableCellWithIdentifier:
, but this might make things more convenient or efficient if your trend and story cells have different content anyway.
Use manual segues. Then your table view controller can implement tableView:didSelectRowAtIndexPath:
to call performSegueWithIdentifier:
with the appropriate identifier chosen based on the index path's section.
Either way, your prepareForSegue:sender:
implementation looks fine.