Szymon Sirocki
Szymon Sirocki

Reputation: 27

Getting hash values from object in swift

In Swift, when I'm typing

var controller : GCController
// fetch some data to conbroller
NSLog("Controller: %@",controller)

NSLog prints nice

Controller: <GCController 0x1700a7680 vendorName='Remote' deviceHash=0x414e6d3d6a8c2215>

wheres vendorName is public variable in GCController, but the deviceHash is not. Can I somehow access the value? Even as plain string? From where NSLog takes the values? I tried making NSString in similar format, but it didn't give me the expected results

Upvotes: 0

Views: 1219

Answers (1)

Alain T.
Alain T.

Reputation: 42129

NSLog is probably showing you the GCController's debugDescription property whereas print and the likes will show you the description property.

Upvotes: 1

Related Questions