objc

Instance Methods | Class Methods
Application Class Reference

The main application class that coordinates application-wide functionality. More...

#import <Application/Application.h>

Inheritance diagram for Application:
Inheritance graph
[legend]
Collaboration diagram for Application:
Collaboration graph
[legend]

Instance Methods

(NXArray *) - args
 Returns command-line arguments passed to the application. More...
 
(id< ApplicationDelegate >) - delegate
 Gets the current application delegate. More...
 
(void) - terminate
 This method notifies the app that you want to exit the run loop. More...
 
(void) - terminateWithExitStatus:
 This method notifies the app that you want to exit the run loop, with a specific exit status. More...
 
- Instance Methods inherited from NXObject
(id- retain
 Increases the retain count of the receiver. More...
 
(void) - release
 Decreases the retain count of the receiver. More...
 
(id- autorelease
 Adds the receiver to the autorelease pool.
 
- Instance Methods inherited from Object
(void) - dealloc
 Free resources for an existing instance.
 
(id- init
 Initialize the instance, after allocation. More...
 
(Class- class
 Returns the class of the instance. More...
 
(Class- superclass
 Returns the superclass of the instance. More...
 
(BOOL- isEqual:
 Compares the receiver to another object for equality. More...
 
(BOOL- isKindOfClass:
 Returns a Boolean value that indicates whether the receiver is an instance of a given class. More...
 
(BOOL- conformsTo:
 Checks if the receiver's class conforms to a protocol. More...
 
(NXString *) - description
 Returns a string that represents the instance. More...
 
- Instance Methods inherited from <ObjectProtocol>
(BOOL- respondsToSelector:
 Checks if the receiver responds to a selector. More...
 

Class Methods

(id+ sharedApplication
 Returns the shared application instance.
 
- Class Methods inherited from NXObject
(id+ allocWithZone:
 Allocates a new instance of an object in a specific memory zone. More...
 
- Class Methods inherited from Object
(void) + initialize
 Performs one-time initialization for the class. More...
 
(id+ alloc
 Allocate a new class instance. More...
 
(Class+ class
 Returns the class object. More...
 
(Class+ superclass
 Returns the superclass of the class. More...
 
(const char *) + name
 Returns the name of the class. More...
 
(BOOL+ conformsTo:
 Checks if the class conforms to a protocol. More...
 
(NXString *) + description
 Returns a string that represents the class. More...
 

Additional Inherited Members

- Protected Attributes inherited from NXObject
id _zone
 The memory zone where the object is allocated.
 
unsigned short _retain
 The retain count of the object.
 
id _next
 The next object in an autorelease pool.
 
- Protected Attributes inherited from Object
Class isa
 A pointer to the object's class structure. More...
 

Detailed Description

The main application class that coordinates application-wide functionality.

The Application class serves as the central hub for application management. An NXApplication instance is created automatically by invoking the NXApplicationMain function, which initializes the application and starts the main run loop.

You don't create instances of this class directly; instead, you use the sharedApplication method to access the singleton instance. The Application class is responsible for handling command-line arguments, setting the application delegate, starting the main run loop, handling events and then terminating the application gracefully.

Definition at line 30 of file NXApplication.h.

Method Documentation

◆ args()

- (NXArray *) args

Returns command-line arguments passed to the application.

Returns
An array of command-line arguments as strings.

This method retrieves the command-line arguments that were passed to the application at startup. It returns an array containing the arguments, the first of which is typically the application name or path to the executable.

◆ delegate()

- (id<ApplicationDelegate>) delegate

Gets the current application delegate.

Returns
The current application delegate, or nil if no delegate is set.

This method returns the object that serves as the application's delegate.

See also
ApplicationDelegate protocol for - delegate methods.

◆ terminate()

- (void) terminate

This method notifies the app that you want to exit the run loop.

The remaining events in the run loop will be processed, and then the application will terminate gracefully.

Note
This method does not immediately terminate the application; it simply sets a flag that will be checked in the run loop.

◆ terminateWithExitStatus:()

- (void) terminateWithExitStatus: (int)  status

This method notifies the app that you want to exit the run loop, with a specific exit status.

The remaining events in the run loop will be processed, and then the application will terminate gracefully.

Note
This method does not immediately terminate the application; it simply sets a flag that will be checked in the run loop. The process will exit with the specified status code.

The documentation for this class was generated from the following file: