CORE DATA objectId changes constantly

前端 未结 2 964
面向向阳花
面向向阳花 2021-01-03 10:37

I have some data that I export into an XML file and put in a remote FTP Server.

I have to identified each object with a unique attribute, it doesn\'t matter wich is,

2条回答
  •  误落风尘
    2021-01-03 11:06

    The NSManagedObjectID is not guaranteed to be consistent. It can change based on a number of factors including data migration and other factors. If you are using this as a unique identifier for your objects, stop.

    The only time you want to use the NSManagedObjectID is when you need to pass references between threads. Other than that situation you should not rely upon it for anything.

    If you need a unique id then create one and store it in your entities.

提交回复
热议问题