home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextDeveloper / Examples / NEXTIME / SimplePlayer / SimplePlayer_main.m < prev    next >
Text File  |  1995-06-23  |  1KB  |  32 lines

  1. /* Generated by the NeXT Project Builder 
  2.    NOTE: Do NOT change this file -- Project Builder maintains it.
  3. */
  4.  
  5. #import <AppKit/AppKit.h>
  6. #import <objc/Object.h>
  7.  
  8. void main(int argc, char *argv[]) {
  9.    NSAutoreleasePool * pool     = [[NSAutoreleasePool alloc] init];
  10.    NSDictionary *info           = [[NSBundle mainBundle] infoDictionary];
  11.    NSString *principalClassName = [info objectForKey: @"NSPrincipalClass"];
  12.    NSString *mainNibFile        = [info objectForKey: @"NSMainNibFile"];
  13.    if (principalClassName) {
  14.       Class principalClass = objc_getClass([principalClassName cString]);
  15.       if (principalClass) {
  16.          [principalClass sharedApplication];
  17.          if ([NSBundle loadNibNamed: mainNibFile owner: NSApp]) {
  18.         [pool release];
  19.             [NSApp run];
  20.             [NSApp release];
  21.             exit(0);
  22.          }
  23.      else NSLog(@"Unable to load nib file: , exiting", mainNibFile);
  24.       }
  25.       else NSLog(@"Unable to find class: , exiting", principalClassName);
  26.    }
  27.    else NSLog(@"No NSPrincipalClass specified in info dictionary, exiting");
  28.    [NSApp release];
  29.    [pool release];
  30.    exit(1);
  31. }
  32.