ObjFW
Classes | Macros
OFApplication.h File Reference
#include <signal.h>
#import "OFObject.h"
Include dependency graph for OFApplication.h:
This graph shows which files directly or indirectly include this file:

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. More...
 

Macro Definition Documentation

◆ OF_APPLICATION_DELEGATE

#define OF_APPLICATION_DELEGATE (   class_)
Value:
int \
main(int argc, char *argv[]) \
{ \
return of_application_main(&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
{
}
@end
#define OF_APPLICATION_DELEGATE(class_)
Specify the class to be used as the application delegate.
Definition: OFApplication.h:55
A class which represents the application as an object.
Definition: OFApplication.h:151
void terminate()
Terminates the application with the EXIT_SUCCESS status.
Definition: OFApplication.m:178
The root class for all other classes inside ObjFW.
Definition: OFObject.h:520
A protocol for delegates of OFApplication.
Definition: OFApplication.h:74