ChecklistItem
テーブル内のエンティティを列挙して、 priority
(NSNumber属性)が1のエンティティが。checklistItems
と多対多の関係にあるかどうかを確認していChecklist
ます。
この単純なコードでは、最初のNSLogは正常に機能し、いくつかのChecklistItemの優先度が1であると報告します。ただし、2番目のNSLogは呼び出されません。どうしてこれなの?「if」ステートメントを間違ってフレーミングしていると思いますが、その方法がわかりません。
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);
}
}