很抱歉新手问题,但我们都在这一点上:)
我正在进行枚举以从 NSSet 中获取正确的对象,以将 Cell 的标题设置为 Set 中的对象,这是我的代码:
// the object we want from the set
MinorGoal *minor = [self.fetchedResultsController objectAtIndexPath:indexPath];
// enumeration
for (NSManagedObject *minorTwo in minorGoalsSet) {
if ([minorTwo == minor]) // I get error here: "Expected Identifier"
cell.textLabel.text = minor.title;
}
当我运行它时,我收到错误:“预期标识符”在这一行:
if ([minorTwo == minor])
感谢您的帮助。
最佳答案
你的言论毫无意义。如果您尝试比较两个对象,则需要发送一条消息:
if ([minorTwo isEqual:minor])
或者类似的东西。由于它们是不同类的实例,因此这可能不太适合您。
关于iphone - NSSet 枚举错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18856223/