Core data How to view Objectid

Source: Internet
Author: User

Objectid is the unique ID identifier provided by core data for each data object, and the method for obtaining Objectid and printing is as follows:

Steps:

1. Get ManagedObject

2. ManagedObject-ObjectID

3. URL ObjectId

4. URL-String

        Nsmanagedobject *managedobject = youmanagedobject;//Gets the object pointer        nsmanagedobjectid *objid = [ManagedObject objectid];//get ObjectID                nsurl * uri = [objId urirepresentation];//objectid-> URL        nsstring *s = [URI absolutest Ring];//url-> String                NSLog (@ "uri =%@", s);//print Objectid corresponding string

Result instances

URI = X-coredata://8fa76f17-3846-4801-b398-80ee9e13ea14/event/p1uri = x-coredata:// 8fa76f17-3846-4801-b398-80ee9e13ea14/event/p2uri = X-coredata://8fa76f17-3846-4801-b398-80ee9e13ea14/event/p3

Core data How to view Objectid

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.