9

enter image description hereI 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.

enter image description here

Vork
  • 746
  • 2
  • 12
  • 34
  • It looks like you forgot to mention any ";" or "," in the code line. or i can't debug that's why it looks like problem with if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) line. – Code Hunterr Jul 06 '15 at 04:31
  • 1
    Duplicate of http://stackoverflow.com/questions/25378474/reference-to-x-is-ambiguous – Jason Jul 06 '15 at 04:45
  • Click on the disclosure next to the error (in the Error navigator on the left). Make the navigator wide enough to show the full messages after you do. Post a screenshot of those messages. – rob mayoff Jul 06 '15 at 04:52
  • @robmayoff:Yes please check the screen shot – Vork Jul 06 '15 at 05:09
  • Actually when I build this in latest iOS 8 sdks I am not getting any error.It is showing problems in sdks 6.1 and other lower versions.But I want to run this in sdks 6.1 itself – Vork Jul 06 '15 at 05:12

5 Answers5

1

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.

ipraba
  • 16,485
  • 4
  • 59
  • 58
1

Actually This error was cleared when I shift from iOS SDK 6.1 to 7.1(or any version higher that 6.1)

Vork
  • 746
  • 2
  • 12
  • 34
  • i am having same ios SDK. and i import UIKit and CoreGraphicsframework the error is shown CGRectMinXEdge is ambiguous in MMDrawer class. what can i do? – ios developer Jul 20 '16 at 13:09
0

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

Community
  • 1
  • 1
Jason
  • 13,563
  • 15
  • 74
  • 125
0

Clean your project and rebuild again.If it don't work then create a new project

Nyka
  • 19
  • 7
-3

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

enter image description here

Mohit Tomar
  • 5,173
  • 2
  • 33
  • 40