From f5d08738c287508ffc9fd0672741dbca9ef50a32 Mon Sep 17 00:00:00 2001 From: Pinglin Tang Date: Wed, 24 Dec 2014 11:57:50 +0800 Subject: [PATCH] Update optional cell textLabel's text. --- Example.xcodeproj/project.pbxproj | 4 ++-- Example/ViewController.swift | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Example.xcodeproj/project.pbxproj b/Example.xcodeproj/project.pbxproj index 8c7df7d5..7279d2bf 100644 --- a/Example.xcodeproj/project.pbxproj +++ b/Example.xcodeproj/project.pbxproj @@ -323,7 +323,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 7.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -361,7 +361,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 7.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; diff --git a/Example/ViewController.swift b/Example/ViewController.swift index ba60cbc8..9d578eab 100644 --- a/Example/ViewController.swift +++ b/Example/ViewController.swift @@ -49,15 +49,15 @@ class ViewController: UITableViewController { switch self.json.type { case .Array: - cell.textLabel.text = "\(row)" + cell.textLabel?.text = "\(row)" cell.detailTextLabel?.text = self.json.arrayValue.description case .Dictionary: let key: AnyObject = (self.json.object as NSDictionary).allKeys[row] let value = self.json[key as String] - cell.textLabel.text = "\(key)" + cell.textLabel?.text = "\(key)" cell.detailTextLabel?.text = value.description default: - cell.textLabel.text = "" + cell.textLabel?.text = "" cell.detailTextLabel?.text = self.json.description }