I am enumerating through the ChecklistItem
entities in my table to see which ones have a priority
(NSNumber attribute) of 1. checklistItems
are in a to-many relationship with Checklist
.
In this simple code, the first NSLog works fine, and reports that several of my ChecklistItems have a priority of 1. But the second NSLog never gets called. Why is this? I assume I'm framing the "if" statement wrong, but I don't know how.
for (ChecklistItem *eachItem in checklist.checklistItems){
NSLog(@"Going through loop. Item %@ has priority %@.", eachItem.name, eachItem.priority);
if (eachItem.priority == [NSNumber numberWithInt:1]) {
NSLog(@"Item %@ has priority 1", eachItem.name);
}
}