简体   繁体   中英

Reference to ' ' is ambigous error in Xcode

在此输入图像描述 I was working with a custom iOS framework project in Xcode.There I am getting a lot of errors mentioning "Reference to ' ' is ambigous".I am attaching the screenshot of errors.Please help me correcting this.

在此输入图像描述

The error message makes me think you have two declarations of the same library functions. All of those references are from UIKit . Check to make sure only one version of UIKit is referenced in your project (check the frameworks), and make sure any libraries you have included are linking the same UIKit version as the rest of the app.

Steps to fix from here:

  • Clean the project
  • Delete everything inside '~/Library/Developer/Xcode/DerivedData/ModuleCache/' (the button inside the organizer window did not work for me)
  • Clean once more
  • Build project

from here: Reference to 'X' is ambiguous

Adding more information to Jason's answer.

The error message makes me think you have two declarations of the same library functions. All of those references are from UIKit

mostly this can be occurring because of the header files. As you can see all the errors indicates that it is quoting the enum values. Enum values will always be in the .h files. Normally the reference headers(.h files) will be present inside the frameworks. It is a common mistake that sometimes these header files will be buried some where in our code by any third party frameworks. So kindly check your third party libraries.

I did face this issue once and after searching everywhere i could not able to find the solution. The only thing solved my issue was

Opening a fresh project and importing my files into that project. Actually it really took me less than 10 minutes to move to a new project and immediately my xcode was happy. This is definitely worth a try.

实际上当我从iOS SDK 6.1转换到7.1(或任何高于6.1的版本)时,此错误已被清除

清理您的项目并重新重建。如果它不起作用,则创建一个新项目

Set value of Enable Module (C and objective-c) to No

在此输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM