似乎几乎是这个问题的重复,但那里的答案并没有解决这个问题。
第一个.h
extern PlanningDocumentService *folderService;
第一个.m
#import first.h
- (void)serviceDefinition
{
PlanningDocumentService *folderService = [_myDocumentViews objectAtIndex:[_gridView indexOfSelectedItem]];
detail.service = folderService;
}
第二个.h
#import first.h
秒.m
#import second.h
+(NSArray*)getDocumentData
{
NSString *passedCaption = folderService.caption;
}
给出错误:
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)
folderService
除了上面的文件,我没有在任何地方声明或定义。欢迎任何想法。