What is the difference between #import and #include in Objective-C?

前端 未结 10 1594
小蘑菇
小蘑菇 2020-11-22 10:12

What are the differences between #import and #include in Objective-C and are there times where you should use one over the other? Is one deprecated?

I was reading th

10条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-22 10:51

    IF you #include a file two times in .h files than compiler will give error. But if you #import a file more than once compiler will ignore it.

提交回复
热议问题