【发布时间】:2020-01-20 07:28:15
【问题描述】:
我有一个会话变量作为 UUID 字段保存在核心数据表中。我对此很满意,它保存正确,因为我可以如下所示打印它。我的问题是我无法设置我的 UUID 变量,它在我的调试窗口中以某种方式返回空白并且不确定我做错了什么。
从我的表格视图中,我选择一行并成功检索核心数据变量,这些变量都是 var = String():
PassNameSurname = userAccountArray[indexPath.row].nameSurname!
PassCompanyOffice = userAccountArray[indexPath.row].companyOffice!
PassEmployNo = userAccountArray[indexPath.row].employeeNumber!
PassAccountPin = userAccountArray[indexPath.row].accountPin!
我的会话变量设置为 UUID() 但在我的调试窗口中返回空白。我已经尝试了以下每一行,打印确实有效,所以我知道核心数据字段有一个值:
PassSessionID = UUID(uuidString: userAccountArray[indexPath.row].sessionID.uuidString)!
PassSessionID = userAccountArray[indexPath.row].sessionID
print(userAccountArray[indexPath.row].sessionID)
【问题讨论】: