AppDelegate.m 1010 B

1234567891011121314151617181920212223242526272829303132333435
  1. #import <UIKit/UIKit.h>
  2. @interface AppDelegate : UIResponder <UIApplicationDelegate>
  3. @property (strong, nonatomic) UIWindow *window;
  4. @end
  5. @implementation AppDelegate
  6. @synthesize window;
  7. - (BOOL)application:(UIApplication *)application
  8. didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  9. #pragma unused (application, launchOptions)
  10. self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
  11. self.window.backgroundColor = [UIColor whiteColor];
  12. [self.window makeKeyAndVisible];
  13. self.window.rootViewController = [[UIViewController alloc] init];
  14. UILabel *label =
  15. [[UILabel alloc] initWithFrame:CGRectMake(0, 200, CGRectGetWidth(self.window.frame), 40)];
  16. label.text = @"Protocol Buffer Test Harness";
  17. label.textAlignment = NSTextAlignmentCenter;
  18. [self.window addSubview:label];
  19. return YES;
  20. }
  21. @end
  22. int main(int argc, char * argv[]) {
  23. @autoreleasepool {
  24. return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
  25. }
  26. }