1

I'm trying to share my CoreData store with my Today extension. I've followed all the posts about creating an app group and adding my dataStore and Models to my extension target.

When I do this though, I get loads of errors on my Model in my extension target.

For instance this method - (NSString *) currentHealthForPeriod { CGFloat healthValue = [[self currentPercentProgressForPeriodWithOffset:0.0] floatValue] - [[self budgetSpentThisPeriodAsPercentage] floatValue]; return [self healthDescriptionForHealthValue:healthValue]; } Has errors for things like 'Use of undeclared identifier CGFloat' and 'Use of undeclared identifier healthValue' - like it doesn't know what a CGFloat is?? Or can't see I've declared healthValue. It's like this on every method.

It's very strange and unexpected. Can anyone help me figure this out? I'm going round in circles.

Cheers

  • Errors like that are often caused by something simple like a missing or extra ; or } - check the lines above the first error carefully and check your included .h files – Paulw11 Sep 28 '14 at 11:26
  • Hi Paul, thanks for your response. No it's not that, the model files are working fine. It's only when I add them to my extension Target as well as the main app that the errors come up. If I then remove them from the extension target, it's all fine again. It's really odd. Any other ideas? – Emile Bennett Sep 28 '14 at 16:11
  • Could you please share more code? This code doesn't seem to have any problem with core data. And Maybe you can describe your file and target relationships in more detail. – CarmeloS Mar 31 '15 at 10:10

1 Answers1

1

You might be simply missing an import of Foundation or CoreGraphics in your header.

@import Foundation;
@import CoreGraphics;
charles
  • 11,212
  • 3
  • 31
  • 46