1

我正在尝试与我的 Today 扩展共享我的 CoreData 存储。我已经关注了有关创建应用程序组并将我的数据存储和模型添加到我的扩展目标的所有帖子。

但是,当我这样做时,我的扩展目标中的模型会出现大量错误。

例如,此方法 - (NSString *) currentHealthForPeriod { CGFloat healthValue = [[self currentPercentProgressForPeriodWithOffset:0.0] floatValue] - [[self budgetSpentThisPeriodAsPercentage] floatValue]; return [self healthDescriptionForHealthValue:healthValue]; } 在“使用未声明的标识符 CGFloat”和“使用未声明的标识符 healthValue”等方面存在错误——就像它不知道 CGFloat 是什么?或者看不到我已经声明了healthValue。每种方法都是这样。

这是非常奇怪和出乎意料的。谁能帮我解决这个问题?我在兜圈子。

干杯

4

1 回答 1

1

您可能只是在标题中缺少 Foundation 或 CoreGraphics 的导入。

@import Foundation;
@import CoreGraphics;
于 2015-03-31T10:03:57.110 回答