2

Using the Refactor->Rename utility in Xcode I renamed a class to be more accurate to what it is. Now when I try to build my project I get a compiler error "Expected a type" in one of my header files when it tries to build one of the Today Extension projects.

#import <Foundation/Foundation.h>
#import "Timetable.h"

@interface NSString (Extras)

- (NSString *)CountdownLabelWithSchedule:(Timetable *)sch;

@end

Xcode is telling me that the error is with the Timetable reference on the last line. There's nothing interesting in Timetable that I think could cause this problem.

#import <Foundation/Foundation.h>

@interface Timetable : NSObject

// Just some NSString & BOOL properties

@end

In the today extension's target under Build Phases->Compile Sources I have Timetable.m included.

I tried cleaning the project and deleting the derived data, but it didn't work.

ecnepsnai
  • 1,882
  • 4
  • 28
  • 56
  • The error is probably elsewhere, perhaps a missing @end in one of your interface files. Try removing the `countDownLabelWithSchedule` method from your interface file and see if it builds. If it doesn't you will have a pointer to where the real culprit is. – Rog Sep 22 '15 at 04:46
  • Well, no it wont build because I use that method. Both timetable and NSString extras have `@end`, I just didn't include them in the post. – ecnepsnai Sep 22 '15 at 04:47
  • What if you try adding `@class Timetable` to that category extension interface? Does it build? – Rog Sep 22 '15 at 04:48
  • try clean or [delete DerivedData](http://stackoverflow.com/questions/18933321/deleting-contents-from-xcode-derived-data-folder) – Bryan Chen Sep 22 '15 at 04:49
  • @BryanChen please read my entire post, I tried that already. – ecnepsnai Sep 22 '15 at 04:50
  • @Rog Yes, it builds now. But why did this work fine without the `@class` before the rename? – ecnepsnai Sep 22 '15 at 04:51
  • You shouldn't need that, I just wanted to see if that really was the root cause of your issue and it seems to be. Now are you 100% positive your `Timetable` class is sentence case as you typed here? Could it be that you refactored it to be `TimeTable` or something along those lines? Is the code above verbatim / copy&paste from your class? – Rog Sep 22 '15 at 05:30

0 Answers0