Skip to content

Instantly share code, notes, and snippets.

@threetreeslight
Last active August 29, 2015 14:02
Show Gist options
  • Save threetreeslight/fe42d3ab67e1598a5a56 to your computer and use it in GitHub Desktop.
Save threetreeslight/fe42d3ab67e1598a5a56 to your computer and use it in GitHub Desktop.
UIAlertView and UIWindow in AppDelegat.m succession
//
// ViewController.m
// TestAlert
//
// Created by akira on 6/10/14.
// Copyright (c) 2014 akira. All rights reserved.
//
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"title" message:@"message" delegate:nil cancelButtonTitle:@"NG" otherButtonTitles:@"OK", nil ];
[alert show];
NSLog(@"viewDidLoad ------------------------------------------------");
NSLog(@"keyWindow: %@", [UIApplication sharedApplication].keyWindow);
NSLog(@"windows : %@", [UIApplication sharedApplication].keyWindow);
}
- (void)viewWillAppear:(BOOL)animated
{
NSLog(@"viewWillApper ------------------------------------------------");
NSLog(@"keyWindow: %@", [UIApplication sharedApplication].keyWindow);
NSLog(@"windows : %@", [UIApplication sharedApplication].keyWindow);
}
- (void)viewDidAppear:(BOOL)animated
{
NSLog(@"viewDidApper ------------------------------------------------");
NSLog(@"keyWindow: %@", [UIApplication sharedApplication].keyWindow);
NSLog(@"windows : %@", [UIApplication sharedApplication].keyWindow);
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment