ObjFW
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

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

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