Share via


UIApplication.Main Method

Definition

Overloads

Name Description
Main(String[])

Launches the main application loop with the given command line parameters.

Main(String[], String, String)
Obsolete.

Launches the main application loop with the given command line parameters.

Main(String[], Type, Type)

Launches the main application loop with the given command line parameters.

Main(String[])

Launches the main application loop with the given command line parameters.

public static void Main(string[]? args);
static member Main : string[] -> unit

Parameters

args
String[]

Command line parameters from the Main program.

Remarks

This launches the main application loop, assumes that the main application class is UIApplication, and uses the UIApplicationDelegate instance specified in the main NIB file for this program.

Applies to

Main(String[], String, String)

Caution

Use the overload with 'Type' instead of 'String' parameters for type safety.

Launches the main application loop with the given command line parameters.

[System.Obsolete("Use the overload with 'Type' instead of 'String' parameters for type safety.")]
public static void Main(string[]? args, string? principalClassName, string? delegateClassName);
[<System.Obsolete("Use the overload with 'Type' instead of 'String' parameters for type safety.")>]
static member Main : string[] * string * string -> unit

Parameters

args
String[]

Command line parameters from the Main program.

principalClassName
String

The name of the main application class, if you specify null, this uses UIApplication.

delegateClassName
String

The name of the UIApplicationDelegate class, if null, it uses the UIApplicationDelegate instance specified in the main NIB file for this program..

Attributes

Remarks

The principalClassName is typically only specified if the application developer subclasses UIApplication, as shown in the following example:

public class Application
{
	static void Main(string[] args)
	{
		UIApplication.Main(args, "MyApp", "MyAppDelegate");
	}
}

[Register("MyApp")]
public class MyApp : UIApplication
{
//...etc...
}          

[Register("MyAppDelegate")]
public  class AppDelegate : UIApplicationDelegate
{
//..etc...
}

Applies to

Main(String[], Type, Type)

Launches the main application loop with the given command line parameters.

public static void Main(string[]? args, Type? principalClass, Type? delegateClass);
static member Main : string[] * Type * Type -> unit

Parameters

args
String[]

Command line parameters from the Main program.

principalClass
Type

The type of the main application class, if you specify null, this uses UIApplication.

delegateClass
Type

The type of the UIApplicationDelegate class, if null, it uses the UIApplicationDelegate instance specified in the main NIB file for this program..

Remarks

The principalClass is typically only specified if the application developer subclasses UIApplication, as shown in the following example:

public class Application
{
  static void Main(string[] args)
  {
    UIApplication.Main(args, typeof (MyApp), typeof (MyAppDelegate));
  }
}

public class MyApp : UIApplication
{
//...etc...
}          

public class MyAppDelegate : UIApplicationDelegate
{
//..etc...
}

Applies to