I am developing an application that uses CoreData.
So in .sqlite file, It manages Primary key itself.
Primary key attribute name is Z_PK
CoreData manages persistent object graphs. It is not a RDBM. You have no control over the unique primary key, so you have no control over its value. It is merely an implementation detail, and should not be referenced for any reason.
Thus, why do you want to sort based on it? I can think of several reasons...
1a. You can add a field to each Entity. You can set it to be a UUID, or in increasing integer.
1b. You could have an entity, something like "EntityList" which has an ordered one-to-many relationship to "Entity."
1c. You could add a one-to-one relationship from Entity to itself, then just manage it like a linked list. Every time you add an Entity, put it at the end of the list.
Either of this solutions give you the ability to access the Entity objects in order they were added.
2a. Add a primaryKey attribute, and assign it a UUID.
2b. Use the ordered to-many relationship.
Finally, if you really want primary-key-based access, I would suggest having a separate sqlite database that you use for special keyed access. You can then associate a key to the objectID of an object in the CoreData store.