Issues with Swift and OC mixed compilation

Source: Internet
Author: User

Recently learning Swift, I would like to use Swift in previous OC projects

At the beginning, the start is relatively fast, the following record a few simple pits.

1. As a result of the contact Swfit some tutorials, so prepare to use swift inside the existing OC, follow the tutorial, no problem, but I use Swift in the original OC, how to compile does not pass,

At the beginning of the error, prompted to find a variety of classes, and then carefully found that the original can not be used in the same project in the OC code to use the Swfit code, and in the SWIFT code using OC, similar to the feeling of a dead loop

You need to compile the project name-swift.h before you can.

2. When the original OC in the conversion method, the main types need to add! , or you often get an error.

3. When using Xib with Swift, there are always inexplicable nsscanner nil errors that have not yet been found, and more when using ScrollView. Temporarily record the reason for subsequent re-search

Issues with Swift and OC mixed compilation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.