Use Visual Studio to compile Objective-C into C ++

Source: Internet
Author: User

Use Visual Studio to compile Objective-C into C ++
Compiler support

Google and Apple both use Clang as their C ++ frontend. To make their code run on Windows, Microsoft had to combine the backend C2 and Clang of Visual C ++.

(Clang is a lightweight compiler for C, C ++, Objective-C, and Objective-C ++. The source code is published under the BSD Protocol. Note by the translator)

IDE support

In Visual Studio, Objective-C supports syntax highlighting, code completion, and debugging. The C ++ and C # files can be included in the same project, allowing programs to be called across regions directly. The compiler will handle all the details, so developers only see the encapsulation of normal function calls.

Most Objective-C Projects are started as XCode projects, so Visual Studio provides the ability to import this project type. The VS and XCode project files can exist in the same project, so that you can develop the same project in the two ides.

Hybrid Projects

Windows provides a new API for Objective-C, such as dynamic tile. To ensure that the Code can continue to be shared between the two platforms, Microsoft provides runtime checks to check whether Windows APIs can be well called. Alternatively, you can use pre-processor commands to isolate the code of a specific platform from the shared code.

Runtime behavior

By default, the Objective-C runtime in Windows detects the original platform of the application to determine its behavior. For example, if you provide an iPhone app, then it will run in a narrow window by default, while the iPad app runs in a normal window.

All these actions can be overwritten by the application as needed.

IOS API compatibility

Windows 10 supports a subset of iOS APIs. It does not track specific versions of iOS, but instead checks which APIs are frequently used in the standard. For the first version, the major concern of Microsoft is as follows:

Games: OpenGL, OpenAL, and sensors
UI: UIKit, CooreAnimation, CoreGraphics, CoreText, Touch
Objective-C: ARC, Blocks, Foundation

For some classes such as sharing, notification, and StoreKit features, developers need to select between retaining iOS APIs and using Windows alternatives. If you choose to retain iOS APIs, Windows will provide a compatibility layer so that the APIs can start to work. The advantage of choosing a Windows alternative solution is that you can use the advanced features of Windows.

Swift

Microsoft's official stance on Swift is "no comment at this time ". That is to say, they want to support Swift, but they are too busy to continue preparing for Objective-C, and may announce about Swift in the fall.

 

 

Thank you for your visit and hope to help you. Welcome to your attention, favorites, and comments.

For this article to get an axe and a question, please indicate the source:
Http://blog.csdn.net/nomasp

Related Article

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.