Compiling objective-c into C + + with Visual Studio

Source: Internet
Author: User

Compiler Support

Both Google and Apple use clang as their C + + front-section. To make their code run on Windows, Microsoft had to combine the back-end C2 and clang of Visual C + +.

(Clang is a lightweight compiler for C, C + +, Objective-c, objective-c++ languages, and the source code is published under the BSD protocol.) Translator Note)

IDE Support

Objective-c has features such as syntax highlighting, code completion, and debugging support in Visual Studio. C + + and C # files can be included in the same project, allowing programs to be called directly across regions. The compiler will handle all the details so the developer just sees the encapsulation of the normal function call.

Most objective-c projects start as a Xcode project, so Visual Studio provides the ability to import the project type. The VS and Xcode project files can exist in the same project, so you can develop the same project in both Ides.

mixed-mode projects

Windows provides new APIs to objective-c, such as live tiles. To ensure that the code can continue to be shared between these two platforms, Microsoft provides runtime checks to see if the Windows API can make a good call. Alternatively, you can use preprocessor directives to isolate specific platform code from shared code.

run-time 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 of these behaviors can be overridden by the application when it is needed.

IOS API Compatibility

Windows 10 supports a subset of iOS APIs. It does not track specific versions of iOS, but instead looks at which APIs are often used in the standard. For the first version, the main APIs that Microsoft focuses on include the following:

Games: Opengl,openal and sensors
Ui:uikit,cooreanimation,coregraphics,coretext,touch
Objective-c:arc,blocks,foundation

Some classes, such as sharing, notification, and Storekit features, developers need to choose between preserving iOS APIs and using Windows alternatives. If you choose to keep iOS apis,windows will provide a compatibility layer, such APIs will be able to start working. The advantage of choosing windows as an alternative is that you can use the advanced features of Windows.

Swift

Microsoft's official stance on Swift is "no comment at this time." Presumably that means they want to support Swift but are too busy at the moment to continue preparing for objective-c, and the fall may announce a message about Swift.

Thank you for your visit and hope to help you. We welcome your attention, collection and comment.

To make this article get treatise and ask questions, reprint please indicate the source:
Http://blog.csdn.net/nomasp

Compiling objective-c into C + + with Visual Studio

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.