@import “Unexpected '@' in program”

前端 未结 4 1354
慢半拍i
慢半拍i 2020-12-13 14:26

I updated project to Xcode 5 and enabled modules in build settings. However, I see compiler error Unexpected \'@\' in program when I use @import.

4条回答
  •  遥遥无期
    2020-12-13 14:59

    From the comment of @hw731 I think you use badly @import :

    old syntax to import framework :

    #import 
    

    but now, you can use the new syntax :

    @import UIKit;
    

    you need to enable theses modules to use the keyword @import (it's enable by default when you create a new project with Xcode 5) :

    enter image description here

    Have a look here.

提交回复
热议问题