The detail (subtitle) text does not appear. The data are available, though, because when a println() call is added, it prints Optional("data") to the console with the expected data. In the storyboard, the UITableViewController is set to the proper class, the Table View Cell Style is set to 'Subtitle', and the reuse identifier is set to 'cell'. How can I get the subtitle information to display?
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { var cell = tableView.dequeueReusableCellWithIdentifier("cell", forIndexPath: indexPath) as UITableViewCell dispatch_async(dispatch_get_main_queue(), { () -> Void in cell.textLabel.text = self.myArray[indexPath.row]["title"] as? String cell.detailTextLabel?.text = self.myArray[indexPath.row]["subtitle"] as? String println(self.myArray[indexPath.row]["subtitle"] as? String) // The expected data appear in the console, but not in the iOS simulator's table view cell. }) return cell }
Your code looks fine. Just goto the storyboard and select the cell of your tableview -> Now goto Attributes Inspector and choose the style to Subtitle.
Follow this according to the below screenshot.
Hope it helped..
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With