Reputation: 321
I have a session variable saved in a Core Data table as a UUID field. I'm happy with that and it saves correct as I can print it as shown below. My problem is that I'm unable to set my UUID variable, it somehow return blank in my debug window and not sure what I'm doing wrong.
From my table view I select a row and retrieve the Core Data variables successfully which are all var = String():
PassNameSurname = userAccountArray[indexPath.row].nameSurname!
PassCompanyOffice = userAccountArray[indexPath.row].companyOffice!
PassEmployNo = userAccountArray[indexPath.row].employeeNumber!
PassAccountPin = userAccountArray[indexPath.row].accountPin!
My session variable is set to UUID() but returns blank in my debug window. I've tried each of the below lines, print does work so I know the Core Data field has a value:
PassSessionID = UUID(uuidString: userAccountArray[indexPath.row].sessionID.uuidString)!
PassSessionID = userAccountArray[indexPath.row].sessionID
print(userAccountArray[indexPath.row].sessionID)
PassSessionID in debug is empty.
Upvotes: 0
Views: 480
Reputation: 9915
NSManagedObject subclasses have @dynamic properties which are not resolved in the Xcode Debugger Variables View. There is more edge cases:
Solution
Extra informations
The Xcode debugging tools are integrated throughout the Xcode main window but are primarily located in the Debug area, the debug navigator, the breakpoint navigator, and the source editor. The debugging UI is dynamic; it reconfigures as you build and run your app. To customize how Xcode displays portions of the UI, choose Xcode Preferences > Behaviors.
The illustration below shows the default layout of the Xcode debugger with the app paused at a breakpoint.
Upvotes: 1