对于新手的问题,很抱歉,但我们都在这一点上:)
我正在进行枚举,以便从NSSet中获取正确的对象,以便将单元格的标题设置为集合中的对象,以下是我的代码:
// 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])谢谢你的帮助。
发布于 2013-09-18 01:31:47
你的声明是无稽之谈。如果您正在尝试比较两个对象,则需要发送一条消息:
if ([minorTwo isEqual:minor])或者其他类似的东西。因为它们是不同类的实例,所以这可能不适合您。
https://stackoverflow.com/questions/18856223
复制相似问题