Home  >  Q&A  >  body text

objective-c - cocoapods 引用的包,一会@import, 一会import "",是我打开方式不对?

引入了几个包,在代码里引用的时候,有的需要

@import module;

有的需要

imoprt <module>

有的需要

import "module.h"

搞得人都屌乱了,这里面有什么原则没有?什么时候用什么方式?

过去多啦不再A梦过去多啦不再A梦2727 days ago515

reply all(3)I'll reply

  • 仅有的幸福

    仅有的幸福2017-05-02 09:20:36

    @import is modules syntax. Use "Language - Modules." in Xcode to set Enable Modules and Link Frameworks Automatically to Yes, which can support @import syntax

    #import<> is the header file in the system framework, and "" is the header file in the project.

    reply
    0
  • PHP中文网

    PHP中文网2017-05-02 09:20:36

    Are you using a new version of Xcode? Just add something to this

    reply
    0
  • 滿天的星座

    滿天的星座2017-05-02 09:20:36

    <> The search starts from the system framework
    "" starts from the project itself
    Old versions can be mixed, but the search speed is different
    I don’t know what the unsigned ones are, I only know these

    reply
    0
  • Cancelreply