简体   繁体   中英

Why need Objective-C bridging header in swift project?

I am new in swift . I crated a swift project and I try to added NSmanagedObject subclass for core data but xcode telling me Would you like to configure an Objective-C bridging header?

what should i do ? and why ?

在此处输入图片说明

Flowing step I done :

create a single page application 在此处输入图片说明

then try to add subclass 在此处输入图片说明

then select the entity would i mange

在此处输入图片说明

then create 在此处输入图片说明

last things why added +coredatapropertice

在此处输入图片说明

Xcode is asking you if you'd like to create a bridging header because you are adding Objective-C files to a Swift project.

Since your project is written in Swift, I'm guessing that you meant to select 'Swift' as the language when creating your NSManagedObject subclasses.

在此处输入图片说明

This way to gain access to a library is to use the Objective-C bridging header. Since Objective-C is a superset of C, the bridging header also works to give you access to pure C libraries. This allow you to add the Objective-C file in our swift project

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM