Is there a way construct a predicate to filter by class type?
I currently loop through the array and check to the class of each object. Maybe there is a cleaner way?
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 could add a category to NSObject that adds a “cf_className” method, like so:
From there, you can use predicates like:
If you’re on the Mac, you can just use
-[NSObject className]instead of having to create the category. The iPhone doesn’t have that method, hence the need for a category.