Getting started with Objective-C

PDF for offline use
Related Samples:

Let us know how you feel about this

Translation Quality


0/250

last updated: 2017-11

This is the getting started page for Objective-C, which covers the basics for all supported platforms.

Requirements

In order to use .NET Embedding with Objective-C you'll need a Mac running:

  • macOS 10.12 (Sierra) or later
  • Xcode 8.3.2 or later
  • Mono 5.0

You can install Visual Studio for Mac to edit and compile your C# code.

Notes:

  • Earlier versions of macOS, Xcode, and Mono might work, but are untested and unsupported;
  • Code generation can be done on Windows, but it is only possible to compile it on a Mac computer where Xcode is installed;

Installation

Your next step is to download and install .NET Embedding on your Mac.

As an alternative it is possible to build it from our git repository, see the contributing document for instructions.

The installer is a standard pkg based installer:

Installer Introduction Installer Install Type Installer Summary

Once installed via the installer, after you start a new terminal session, you can use the objcgen command. Otherwise you can always run the tool via its absolute path: /Library/Frameworks/Xamarin.Embeddinator-4000.framework/Commands/objcgen.

Platforms

Objective-C is a language that is most commonly used to write applications for macOS, iOS, tvOS and watchOS; and the embeddinator supports all of those platforms. Working with each platform implies some key differences and these are explained here.

macOS

Creating a macOS application is easiest since it does not involve as many additional steps, like setting up identity, provisining profiles, simulators and devices. You are encouraged to start with the macOS document before the one for iOS.

iOS / tvOS

Please make sure you are already set up to develop iOS applications before trying to create one using the embeddinator. The following instructions assume that you have already successfully built and deployed an iOS application from your computer.

Support for tvOS is analogous to how iOS works, by just using tvOS projects in the IDEs (both Visual Studio and Xcode) instead of iOS projects.

ℹ️

Note: Support for watchOS will be available in a future release and will be very similar to iOS/tvOS.

Further Reading

Xamarin Workbook

If it's not already installed, install the Xamarin Workbooks app first. The workbook file should download automatically, but if it doesn't, just click to start the workbook download manually.