How to print a NSInteger value from an NSManagedObject using NSLog

前端 未结 5 1312
北恋
北恋 2021-01-12 06:15

When I try to print an integer value to the console that is retrieved from an NSManagedObject, it displays a 6 or 8 digit value (the object ID?). However, if I use the debug

5条回答
  •  南笙
    南笙 (楼主)
    2021-01-12 06:33

    It sounds like myProcess.sequence is an NSNumber (object) rather than an NSInteger (scalar). That would explain why it shows up correctly in an object's description but not when you explicitly try to print it as an integer.

提交回复
热议问题