The App Object

Every project has an App object that is automatically added to it when the project is created. This App object gives you access to events and properties that are specific to the app type. If you look at the Inspector for the App object, you'll see that it has a super which varies by project type:

Project Type

Application Class

Android

MobileApplication

Console

ConsoleApplication

Desktop

DesktopApplication

iOS

MobileApplication

Web

WebApplication

Accessing the App Object

You can set the scope of properties, methods and constants of the App subclass using the same rules as for any class.

The global App function gives you a reference to the App class in your project so that you can access its public properties, methods and constants.

To access a public property somewhere in your project, you would write it like this:

value = App.MyProperty

You can rename the App object to give it a more descriptive name. If you do, you still use the App function to get access to it.

If you wish, you can even subclass App. When you do this on a desktop project, your new subclass gets the properties for the default window, menu bar and icon. If you have subclassed App, the App function gives you a reference to the subclass instead.

Note

You use the App function to get a reference to the App object even if you have renamed or subclassed the App object.