0

I accidentally removed app delegate.m and .h file from the folder of the app.

Then in xcode I could see the name (Appdelegate.h and .m) but with no content.

I found the files in the trash and I dragged and dropped them in the xcode and now I see doubles of both files.

If i try to run my project I keep getting this error:

duplicate symbol _OBJC_IVAR_$_AppDelegate._window in:

If I remove the one of the two duplicates, both are being deleted.

4

2 に答える 2

2

delegate.mCompile-Sources内に1回だけリストされていることを確認してください。

それを成し遂げるために; プロジェクトナビゲータ内の左上にあるプロジェクトをタップし、ターゲットをタップして、選択しBuild Phases、展開Compile Sourceして、そこに1回だけ存在するかどうかを確認delegate.mします。

于 2012-09-15T16:51:17.727 に答える
0

@Tillの回答に加えて、プロジェクトのDerivedDataフォルダーを削除して、プロジェクトを最初から再構築することもお勧めします([製品]メニューで[クリーン]を実行するだけで十分な場合があります。または、[クリーン]メニュー項目でAlt-Clicを実行して「CleanBuildFolder…」を選択する方が少し良いですが、それだけでは不十分な場合もあります)

すべての中間ファイルを削除し、Xcodeにプロジェクトを最初から再構築させ、古いビルドファイルを使用しないようにするには、次の手順を実行します。

  • オーガナイザーを開きます(メニュー「ウィンドウ」)
  • [プロジェクト]タブに移動し、左側でプロジェクトを選択します
  • 「派生データ」行の横にある「削除」ボタンをクリックします
  • プロジェクトを再構築します
于 2012-09-15T16:54:46.553 に答える