I am getting "Cyclic dependency in module 'Foundation': Foundation -> UIKit -> QuartzCore -> Foundation" Error when i build my project.how to resolve it. i have refer below links answer but its not work for me.I have remove derived data and quit xcode many times still i am getting this error.
Asked
Active
Viewed 7,430 times
4
-
are u going to import your.h file in AppDelegate? – Suraj Sukale Jun 13 '16 at 11:18
-
have you imported .m file instead of .h file anywhere? it happens... – Rok Jarc Jun 13 '16 at 12:03
-
1What is the name of the source file that is generating that error message? – Droppy Jun 13 '16 at 13:06
-
@rokjarc no i have imported .h file – Rushabh Jun 13 '16 at 13:32
-
@Droppy Error message come from UIKit and Foundation Framework not from classes. – Rushabh Jun 13 '16 at 13:33
-
Yes, but it was generated during the compilation of a file, no? – Droppy Jun 13 '16 at 13:34
-
@Rushabh - Are you using .pch file ? – gagan sharma Jun 14 '16 at 06:07
-
@gagansharma yes i am using .pch file – Rushabh Jun 14 '16 at 13:48
-
@Rushabh - Please see my answer below I have edited, might help you. – gagan sharma Jun 21 '16 at 07:23
-
Try to move your `#import`s from .h files into .m files as much as you can. – Nicolas Miari Jun 21 '16 at 07:25
2 Answers
1
Maybe you can break the cyclic import by #import
one in the .m file
,or you can learn to use @import
the new feature which use the module map made dependency.

Bhadresh Mulsaniya
- 2,610
- 1
- 12
- 25

Guo Fangqing
- 11
- 1
1
This might generalise your situation - You have imported class B into class A and now you are importing class A in class B, so in second case rather than importing class A in B use forward declaration - Use @class A in class B (second case). If you are using .pch file, you might be adding Framework or Headers twice. In .pch file and in other files as well. In your case try removing the UIKit and Foundation frameworks either from .pch file or from other place where you are adding them repetitively.

gagan sharma
- 256
- 1
- 4
- 18