Xcode 上的奇怪错误:解析问题 Unknown type name 'plementation'
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7361507/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Strange error on Xcode : parse issue Unknown type name 'plementation'
提问by Beuj
on the line:
在线上:
@implementation AccountCreateViewController
@synthesize profileFacebook;
@synthesize facebook;
Xcode 4 says :Error parse issue Unknown type name 'plementation' There are a lot of parse issue after that. But the project works on an iPhone.
Xcode 4 说:Error parse issue Unknown type name 'plementation' 之后有很多解析问题。但该项目适用于 iPhone。
I really don't know what it is... I try to convert the file in CR/LF (it was LF before), it didn't work.
我真的不知道它是什么......我尝试将文件转换为 CR/LF(之前是 LF),它没有用。
ps:
附:
采纳答案by Andrew
I think I might have fixed it. It seems that LLVM Clang doesn't like UTF-8 BOM encoding.
我想我可能已经修复了它。LLVM Clang 似乎不喜欢 UTF-8 BOM 编码。
See this Code Issue on the Sudzc website.
请参阅 Sudzc 网站上的此代码问题。
http://code.google.com/p/sudzc/issues/detail?id=27
http://code.google.com/p/sudzc/issues/detail?id=27
For my own project, I opened up the offending files with TextWrangler and re-saved them with "Western (Mac OS Roman) encoding. So far I haven't gotten any further problems from LLVM/Clang.
对于我自己的项目,我使用 TextWrangler 打开了有问题的文件,并使用“西方(Mac OS Roman)编码”重新保存了它们。到目前为止,我还没有从 LLVM/Clang 中得到任何进一步的问题。
回答by tipycalFlow
I got the same error but in my .h
file. I fixed it simply by a forward declaration as:
我遇到了同样的错误,但在我的.h
文件中。我只是通过前向声明将其修复为:
#import "MyCustomClassThatGaveParseError.h" // existed before the error
@class MyCustomClassThatGaveParseError; // added to remove the weird error
回答by Roozbehan
Maybe this is not a "solution" but that's how I solved my problem anyway. I changed the base SDK from OS X 10.8 back to OS X 10.7 and everything works fine now.
也许这不是“解决方案”,但这就是我解决问题的方式。我将基本 SDK 从 OS X 10.8 改回 OS X 10.7,现在一切正常。