English 中文(简体)
SBJsonBase 类的复制界面定义吗?
原标题:Duplicate interface definition for class SBJsonBase?

我把Facebook Sdk 代码添加到我的工程中, 然后我就犯了这个错误, 因为我已经有一个json 图书馆, 所以我从我的计算机和项目中删除了 Facebook json 库, 但我仍然得到了这个错误。 我搜索整个工程的“ @ interface SBJsonBase ”, 我只能找到一个结果 。 当我只有一个接口时, 它怎么能说它是复制品? 它是否包含文件两次? 搜索是否总是不能找到所有东西?

最佳回答

有用吗? 删除您的源数据, 并进行清洁工程, 然后尝试重建

问题回答

I had a simular problem. It was a small search, but I could solve it without creating a new project etc. The thing was I had a Class B that was importing Class A. Then I had a class that imported Class B and also Class A. When I did this, these problems occured. Eg. A SOAP webservice Class imports all the Entities that are passed over the web.

去学校网络服务。

import "person.h"

import "school.h"

.

然后,我有一个单吨级 用来缓存, 记录在人 和ref到网络服务类。

import "person.h"

import "goToSchoolWebservice.h"

--> this is where is went wrong!! So watch out for these circular references. ITs not so easy to detect them!

如果您使用 # 包含而不是导入的话, 那么使用此技术来最小化重复 : 在您界面( 实际在它之前) 的起始时, 请检查定义, 如果没有定义的话, 然后定义定义它, 然后继续定义您的界面 。 这里举一个例子 :

 #ifndef __NetworkOptionsViewController__H // check if this has every been imported before
 #define __NetworkOptionsViewController__H


#import "blahblah.h"

 @interface NetworkOptionsViewController : UITableViewController

 {

NSMutableArray* somevariable1;
int somevariable2;


 }
 @end



 #endif

对于我个人来说,我得到了这个错误, 虽然是因为我班级的文件路径错误。 我检查了文件检查员, 我的班级文件没有在分类文件夹中定义, 尽管 IDE 说它是。 我删除了它们, 并再次复制了它们 。

对于仍然会犯这个错误的人来说,尽管有下列页眉进口协议:我从进口一个从项目中删除的页眉中得到了这个错误。 缺少的页眉是在我的项目的旧备份中找到的( 在 Git 做一些破坏性工作之前我做的 ), 而那个文件导致了循环导入 。





相关问题
How to change out-of-focus text selection color in Xcode?

Okay, I ll bite. I ve got really pleasant code/window colors set up in Xcode. Ordinarily, my selection color is very visible. When I am doing a project search and iterating through the results, ...

Iphone NSTimer Issue

Hi I am new to objective c. I am trying to make an app for iphone. I have a button on my view, and the click on which the function playSound is called. This is working properly. It does plays the ...

Include a .txt file in a .h in C++?

I have a number of places where I need to re-use some template code. Many classes need these items In a .h could I do something like: #include <xxx.txt> and place all of this code in the ....

Iterating over string/strlen with umlauted characters

This is a follow-up to my previous question . I succeeded in implementing the algorithm for checking umlauted characters. The next problem comes from iterating over all characters in a string. I do ...

Xcode open two editor windows with same file

Is it possible to open the same file in two separate windows in Xcode. I can open a file in one window and the same file in the main Xcode editor window, but I wanted two separate fulltime editor ...

Forcing code signing refresh in Xcode

In our environment, we share resources across multiple projects and platforms. When building for iPhone, only a subset of those resources are needed. Since that subset is still considerable, we have ...

热门标签