> On Oct 10, 2015, at 03:25, Quincey Morris > <[email protected]> wrote: > > On Oct 9, 2015, at 21:36 , Alex Hall <[email protected] > <mailto:[email protected]>> wrote: >> >> I'm playing with tables on iOS, because they're central to many apps but >> I've never really used them. I have a UITableView displaying rows of data, >> which is good, but tapping on a row does nothing, which is the problem. I've >> made a segue from the "detail" view to the table cell, and prepareForSegue() >> is implemented in the table view's view controller. Yet, the detail view >> never shows up in the app. >> >> I'm pretty sure my problem is that my cell isn't officially part of my >> table. The table didn't come with any cells, so I dragged one over. >> Tutorials say that I should control-drag from the cell to the table, but >> that doesn't do anything with VoiceOver, and I can't see why I'd have to do >> it anyway. The cell is already nested in the table; can't Xcode work out the >> relationship from there? Of course, this may already be all set, and the >> problem is elsewhere. >> >> I guess my question for the list is: how do I make sure my cell is connected >> to my table so that it, not one generated in the data source, is the one >> used? If my cell isn't used, the segue won't be attached and nothing would >> happen when a cell were tapped, which is what I'm seeing. > > I’m not quite sure what to make of your description here. You seem to talking > about tapping on a row to go to a detail view, sort of like in the Settings > app, but you said you made a segue from the detail view to the table cell, > which seems like the wrong direction.
I'll try it the other way. When I make a segue from, say, a button to a scene, I drag from the scene's connections inspector to the button that will launch the segue, so I figured I should do the same thing here--from the scene to the cell. > > Also, the are two kinds of UITableViews — really, two ways of using > UITableView. One is with static cells, where the row structure is fixed in > advance (again like the Settings app), the other is with dynamic cells, where > the data source determines what the rows are. Yes, sorry, I forgot to specify. I'm using dynamic cells. > > If your table is configured with static cells, then it should show the exact > cells designed in IB. In that case, you don’t want a data source (and > probably shouldn’t have one, but it’s a while and several iOS versions since > I’ve done this, so my memory of the details is hazy). > > If your table is configured with dynamic cells, you can add other cells to > the IB design, but you need to choose which kind of cell gets created for any > given row by instantiating it in ‘tableView:cellForRowAtIndexPath:’ with the > correct cell identifier. That's what I'm doing now. > > In neither case is there any control-dragging (that I can remember) to > configure the cell into its table. Maybe the tutorials were talking about > control-dragging to create a segue from the cell to another table that is > actually the detail view? I've read so many in the last couple days it's hard to say, but I know none of them were showing a second table. > -- Have a great day, Alex Hall [email protected]
_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/xcode-users/archive%40mail-archive.com This email sent to [email protected]
