Creating the Example iOS Mobile App

The following section describes the procedures for creating the example iOS App.

  1. Open Microsoft Visual Studio. (Visual Studio 2012 Professional and higher are the only versions of Visual Studio that are compatible with Xamarin.iOS.).
  2. On the New Project form, select iOS\Universal in the sidebar and create a new Blank App (iOS) using .NET Framework 4.5. (Visual C# is used in this example).

  3. Set the Name and Solution Name properties to MyApp.
  4. Add any required references to the Solution. The following is required for this example:
    1. Right-click on References in the Solution Explorer and select Add References.
    2. Select the Browse tab and return IOM.IOS.dll from the ‘bin\Debug’ folder of the Solution. The file can be copied to this location from the ‘\Utilities\Aras Innovator <Version> IOM SDK\COM\IOS’ directory on the Aras Innovator CD Image.
  5. Connect your Mac or iOS device by selecting the appropriate platform.
    1. From the main menu select Project -->MyAppProperties and then iOS Application.
    2. For this example project choose iPhoneSimulator for the platform.

  1. Add a new controller to your project called MyController.cs.
    • In the Solution Explorer, right-click MyApp--> Add -->New Item,and thenUI in the list on the left side of the window.
    • Select UIViewController class, set the name to MyController.cs and then click Add.

  2. Add the following lines to the top of MyController.cs:
  3. using Aras.IOM;
    using System.Threading;
  4. Replace the UIViewController class code in MyController.cs with the code in Appendix B, section 7.1.1
  5. After pasting in the code, substitute the correct values for the Aras Innovator Server and database name of your Aras Innovator instance:
  6. ...
    //create connection to Innovator server
    HttpServerConnection connection = IomFactory.CreateHttpServerConnection (“http://localhost/InnovatorServer/Server/InnovatorServer.aspx”, “InnovatorSolutions”, “admin”, “innovator”);
     ...
  7. Open AppDelegate.cs from the Solution Explorer, and add the lines highlighted below:
  8. [Register(“AppDelegate”)]
    public partial class AppDelegate : UIApplicationDelegate
    {
     // class-level declarations
     UIWindow window;
     MyController viewController;
     ...
     public override bool FinishedLaunching(UIApplication app, NSDictionary options)
     {
     // create a new window instance based on the screen size
     window = new UIWindow(UIScreen.MainScreen.Bounds);
     // If you have defined a view, add it here:
     // window.RootViewController = navigationController;
     viewController = new MyController();
     window.RootViewController = viewController;
     // make the window visible
     window.MakeKeyAndVisible();
     return true;
     }
    }
  9. Compile and run your project. Your app should appear in Xcode’s iOS Simulator on your Mac.