Nico Nico - 1 month ago 14
iOS Question

Xcode 8 print function just print the name of the object and its address in memory

With Xcode 8, when I do a

print("user : \(user)")
, in the console I only get
user : <Object_Class: 0x6080000b3fe0>
. Is there a way to have a more detailed print?

EDIT:

The class is
FIRUser
(Firebase).

/** @class FIRUser
@brief Represents a user.
@remarks This class is thread-safe.
*/
@interface FIRUser : NSObject <FIRUserInfo>

Answer

You need this class to conform to CustomStringConvertible and implement the description property.

Comments