Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Michael Trilford
7,232 PointsSelecting iOS Table Cells
Is there an easy way to select a table cell in xCode through code? The following doesn't exist, but this would be ideal
self.tableView.cell
Basically I am trying to style placeholder text to be white, any simple solution? From what I have seen, it takes quite a few lines to customise these sections.
2 Answers
landonferrier
25,097 PointsMichael,
Here is what you need to do to select a row from a table view:
[self.tableView selectRowAtIndexPath:(A Number) animated:YES scrollPosition:UITableViewScrollPositionNone];
If this causes in error in code, remember the tableView is only a property of UITableViewController subclasses.
If you have any questions, feel free to ask!
Michael Trilford
7,232 PointsThanks for the answer Landon, I gave it a go, but it still was a little technical for me. I ended up using the User Defined Runtime Attributes. Seemed to do the trick
