1

我正在处理 Xcode 中的一个解析问题,它触发了一个失败的问题,而不是一个警告,并且关于此的信息很少或没有。它似乎与 LLVM 相关,但由于我不是编译器人员,所以存在的少量技术文档对我来说毫无意义,存在的非技术答案无助于解决这个问题。

我已经进入管理器并删除了该项目的派生数据,我确保设置了所有可以设置为目标应用程序的文件,清理了项目,搜索(无用)“类型名称”等。打开项目后仍然会立即出现此错误。当我今天将项目签出到一台新机器上时,这似乎已经开始,但直到我进行测试构建时我才注意到它。有任何想法吗?

我不仅在寻找一个让我度过一天的答案,我还在寻找对错误的解释,以便我将来避免它。有一个“重复”的问题,但没有有用的答案,也没有什么可以解释到底发生了什么

问题代码如下,错误标记在行上@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:");

}
4

1 回答 1

3
const NSString 

@interface OCSystemReportParser () // ERROR IS FLAGGED HERE

问题是那const NSString句话。它是无效的,或者以分号结尾,所以编译器说它不能与有意义的东西结合@interface起来const NSString

于 2012-07-13T15:16:19.870 回答