ObjFW
Loading...
Searching...
No Matches
Classes | Macros | Variables
OFApplication.h File Reference
#include <signal.h>
import "OFObject.h"
import "OFNotification.h"

Go to the source code of this file.

Classes

protocol  <OFApplicationDelegate>
 A protocol for delegates of OFApplication. More...
 
class  OFApplication
 A class which represents the application as an object. More...
 

Macros

#define OF_APPLICATION_DELEGATE(class_)
 Specify the class to be used as the application delegate.
 

Variables

const OFNotificationName OFApplicationDidFinishLaunchingNotification
 A notification that will be sent when the application did finish launching.
 
const OFNotificationName OFApplicationWillTerminateNotification
 A notification that will be sent when the application will terminate.
 

Macro Definition Documentation

◆ OF_APPLICATION_DELEGATE

#define OF_APPLICATION_DELEGATE ( class_)
Value:
int \
main(int argc, char *argv[]) \
{ \
return OFApplicationMain(&argc, &argv, \
(class_ *)[[class_ alloc] init]); \
}

Specify the class to be used as the application delegate.

An instance of this class will be created and act as the application delegate.

For example, it can be used like this:

// In MyAppDelegate.h:
@interface MyAppDelegate: OFObject <OFApplicationDelegate>
@end
// In MyAppDelegate.m:
@implementation MyAppDelegate
- (void)applicationDidFinishLaunching: (OFNotification *)notification
{
}
@end
#define OF_APPLICATION_DELEGATE(class_)
Specify the class to be used as the application delegate.
Definition OFApplication.h:71
A class which represents the application as an object.
Definition OFApplication.h:177
void terminate()
Terminates the application with the EXIT_SUCCESS status.
Definition OFApplication.m:199
A class to represent a notification for or from OFNotificationCenter.
Definition OFNotification.h:42
The root class for all other classes inside ObjFW.
Definition OFObject.h:692
A protocol for delegates of OFApplication.
Definition OFApplication.h:90