how do I ask core data to fetch me the last 30 elements entered or alternatively the elements entered within a month of today?
Share
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.
To fetch a certain number of records, use qualification like
[fetchRequest setFetchLimit:30]in combination with NSPredicate instance you desired.To retrieve elements within a range of time, you need first calculate the beginning and the end NSDate instances of the period you want, then code your predicate instance like:
See this and this.