Seems to be almost a duplicate of this question, but the answer there hasn't addressed the problem.
first.h
extern PlanningDocumentService *folderService;
first.m
#import first.h
- (void)serviceDefinition
{
PlanningDocumentService *folderService = [_myDocumentViews objectAtIndex:[_gridView indexOfSelectedItem]];
detail.service = folderService;
}
second.h
#import first.h
second.m
#import second.h
+(NSArray*)getDocumentData
{
NSString *passedCaption = folderService.caption;
}
Gives the error:
Undefined symbols for architecture i386:
"_folderService", referenced from:
+[GenericService getDocumentData] in GenericService.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I haven't declared or defined folderService
anywhere other than the files above.
Any ideas welcomed.