我正在处理Xcode中的解析问题,该问题触发了一个失败的问题,而不是一个警告,并且几乎没有关于此的信息。它似乎与LLVM相关联,但由于我不是编译人员,所以存在什么样的技术文档对我来说没什么意义,并且存在哪些非技术性答案无助于解决这个问题。
我已经进入Organizer并删除了这个项目的派生数据,我确保所有可以设置到目标应用程序的文件都已设置,清理项目,搜索(futiley)'type-name'等。打开项目后立即出现此错误。这似乎是在我今天将项目签出到新机器上时开始的,但在我进行测试构建之前我没有注意到它。有什么想法吗?
我不仅在寻找能让我度过一天的答案,而且我还在寻找错误的解释,以便将来避免错误。 There is a "duplicate" question但是没有有用的答案,没有什么可以解释真正发生的事情
问题代码如下,错误标记在@interface OCSystemReportParser ()
行。
这是有问题的标题......
#import <Foundation/Foundation.h>
@interface OCSystemReportParser : NSObject
- (void) parseSystemReports:(NSArray *)systemReports;
@end
......以及有问题的实施......
#import "OCSystemReportParser.h"
/*
System Report Keys
*/
NSString* const OCKeyApplications = @"Applications";
NSString* const OCKeyHardware = @"Hardware";
NSString* const OCKeyMemory = @"Memory";
NSString* const OCKeySoftware = @"Software";
/*
Parsed Data Keys
*/
const NSString
@interface OCSystemReportParser () // ERROR IS FLAGGED HERE
// keywords whose data we need
@property (strong, readwrite, nonatomic) NSArray *actionableKeywords;
// lines for the current report
@property (strong, readwrite, nonatomic) NSArray *reportSource;
// key-value pairs for the information in the system report
@property (strong, readwrite, nonatomic) NSMutableDictionary *parsedData;
// completed dictionaries of parsed reports
@property (strong, readwrite, nonatomic) NSMutableArray *completedReports;
@end
@implementation OCSystemReportParser
@synthesize actionableKeywords = _actionableKeywords;
@synthesize reportSource = _reportSource;
@synthesize parsedData = _parsedData;
@synthesize completedReports = _completedReports;
#pragma mark -
#pragma mark Object Lifecycle Stack
#pragma mark -
#pragma mark -
#pragma mark File Input Stack
#pragma mark -
/*
Kicks off the process of data collection. This is the only public method.
*/
- (void) parseSystemReports:(NSArray *)systemReports {
//NSLog(@"OCSystemReportParser:parseSystemReports:%@", systemReports);
for ( NSString *path in systemReports ) {
// reset the dictionary
self.parsedData = [NSMutableDictionary dictionary];
// generate and parse the source data
self.reportSource = [self createArrayWithReport:[self readReport:path]];
//[self parseReport];
// save the results
[self.completedReports addObject:self.parsedData];
}
[self outputCompletedReports];
}
/*
returns a string of the content of the report file
*/
- (NSString *) readReport:(NSString *)path {
//NSLog(@"OCSystemReportParser:readReport:%@", path);
return nil;
}
/*
returns an array containing the report data clean of empty lines and whitespace
*/
- (NSArray *) createArrayWithReport:(NSString *)reportData {
//NSLog(@"OCSystemReportParser:createArrayWithReport:");
return nil;
}
#pragma mark -
#pragma mark Housekeeping Stack
#pragma mark -
/*
Handles the initialization and population of helper data
*/
- (void) initializeKeyValues {
//NSLog(@"OCSystemReportParser:initializeKeyValues:");
self.actionableKeywords = [NSArray arrayWithObjects:OCKeyApplications, OCKeyHardware, OCKeyMemory, OCKeySoftware, nil];
}
#pragma mark -
#pragma mark Data Parsing Stack
#pragma mark -
/*
Kicks off the parsing of the strings in the report array
*/
- (void) parseReport {
//NSLog(@"OCSystemReportParser:parseReport:");
}
/*
Gets the computer type and user name from the header of the report
*/
- (void) parseUserInformation {
//NSLog(@"OCSystemReportParser:parseUserInformation:");
// information is in line 1
// ComputerModel Firstname Lastname
}
#pragma mark -
#pragma mark File Output Stack
#pragma mark -
/*
Kicks off the output process starting with the completed reports
*/
- (void) outputCompletedReports {
//NSLog(@"OCSystemReportParser:outputCompletedReports:");
}
答案 0 :(得分:3)
const NSString
@interface OCSystemReportParser () // ERROR IS FLAGGED HERE
问题在于const NSString
声明。它无效,或以分号结束,因此编译器表示它无法将@interface
与const NSString
合并为有意义的内容。