How does one choose which Core Data record to fetch?
I have one entity, “Credit Card”, and I have ten actual credit cards stored in that entity. How do I say “Hey, I want to fetch THAT card?”
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You create an NSFetchRequest with a predicate that identifies the credit card you want (e.g.,
id = 3orcardHolderName = "JOE SMITH"), then ask the NSManagedObjectContext to execute the fetch request, returning the result set (which will contain the one card you want).