Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
模拟器iOS 7.1中的ACAccount.h出错_Ios_Objective C_Xcode_Acaccount - Fatal编程技术网

模拟器iOS 7.1中的ACAccount.h出错

模拟器iOS 7.1中的ACAccount.h出错,ios,objective-c,xcode,acaccount,Ios,Objective C,Xcode,Acaccount,我正试图用xcode模拟器构建和测试一个应用程序,但在构建过程中,我在ACAccount.h、ACAccountType.h等中遇到了错误。 “奇怪的事情”(至少对我来说,因为我对使用xcode是完全陌生的)是,如果我点击有错误的.h文件,它们不会出现在项目代码下,而是在下面 Simulator - iOS 7.1-> Frameworks -> Accounts -> ACAccount.h 这是不可修改的 错误的例子有: 行: @class ACAccountType,

我正试图用xcode模拟器构建和测试一个应用程序,但在构建过程中,我在ACAccount.h、ACAccountType.h等中遇到了错误。 “奇怪的事情”(至少对我来说,因为我对使用xcode是完全陌生的)是,如果我点击有错误的.h文件,它们不会出现在项目代码下,而是在下面

Simulator - iOS 7.1-> Frameworks -> Accounts -> ACAccount.h
这是不可修改的

错误的例子有:

行:

 @class ACAccountType,ACAccount Credential;    --> Illegal interface qualifier

 ACCOUNTS_CLASS_AVAILABLE(NA, 5_0)
 @interface ACAccount : NSObject       -->Objective-C declarations may only appear in global scope
如果.h是预定义文件。。如何解决这些错误


非常感谢

通常,当您在系统提供的标题中遇到诸如“非法接口限定符”之类的项目时,表示您已将
#import
语句放置在
@interface
块中,例如:

@interface foo ()

#import <Accounts/ACAccount.h>

@end
@interface foo()
#进口
@结束
这会生成有关导入文件中内容的错误(例如,
非法接口限定符
错误),而实际问题是将
#import
语句放入
@接口
块无效

您应该将
#import
语句放在文件顶部,在任何
@接口
@实现
块之外

如果将其放入
@implementation
部分,则错误为:

错误:Objective-C声明只能出现在全局范围中


如果这是头文件的复制粘贴,则表明该文件已以某种方式损坏-出现错误的第一行应为:
@class ACAccountType,ACAccountCredential-即转发类声明。是,这是复制粘贴错误。。“;”在一行中。。问题已更正显示正在执行
ACAccount.h
#import
的部分文件-它看起来像是将
#import
放在
@interface foo()
@end
块中。导入语句最好放在任何
@
部分之外的文件顶部。请将此作为答案填写,以便我可以接受:)