Why do Xcode templates have #imports that duplicate Prefix.pch?

后端 未结 2 1053
情书的邮戳
情书的邮戳 2020-12-06 04:55

While learning iPhone programming, every Xcode template I\'ve seen includes an AppName-Prefix.pch file with the following contents:

#ifdef __OBJC__
    #impo         


        
2条回答
  •  难免孤独
    2020-12-06 05:46

    Why have both?

    Better safe than sorry. Precompiled headers can be disabled, and since #import won't import anything twice, the overhead is negligible.

提交回复
热议问题