0
,並在功能:設置謂詞我使用的核心數據正在提取請求
- (NSFetchedResultsController*)fetchedResultsController()
我想用一個謂詞,可以讓NSFetchRequest返回具有給定的關係價值的管理對象。我試過這個:
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"belongToS like[cd] %@", (S*)self.s];
[fetchRequest setPredicate:predicate];
Note:
- belongToS: relationship of type (S *)
- self.s is a managed object casted to type (S *) since it is of NSManagedObject and actually it's truly an object of type (S *).
當我運行代碼它不會返回任何東西!我如何編輯它使其工作?是否有任何最佳的解決方案來獲取具有相同關係值的對象?
(假設'belongToS'是「一對一」的關係。) –