我在从3个关联实体获取核心数据信息方面存在问题,其中一些工作有效,而有些工作不起作用。
Model
Entity Accounts RegDate
relationship heldby >> to-many >> inAccounts
attributes balance addDate
name
Entity RegDate Regster
relationship regheldBy >> to-many >> inRegDate
attributes addDate amount
当我这样做时:
Regster *regster = [self.fetchedResultsController objectAtIndexPath:indexPath];
cell.textLabel.text = regster.amount;
NSLog(@"Regster: %@ %@", regster.amount, regster.inRegDate.addDate);
regster. amount 显示预期值, 但 Regster. inRegDate.addDate null 显示正负值 。
当我这样做时:
RegDate *regdate = [self.fetchedResultsController objectAtIndexPath:indexPath];
cell.textLabel.text = regdate.addDate;
NSLog(@"RegDate: %@", regdate.addDate);
regdate.addDate displays the expected value, whereas previous example I get null. Additionally, I cannot get amount to display. I thought I could use: regdate.regheldBy.amount > but this give error "Property amount not found on object of type NSSet "
我不知道我做错了什么 我想我可能把关系安排得不对 我尝试过很多不同的东西
有什么想法吗?