Posted By

takezou621 on 02/27/11


Tagged


Versions (?)

ApplicationDelegateオブジェクトを取得する


 / Published in: Objective C
 

  1. -(UIWindow*) delegateWindow{
  2.  
  3. UIWindow *result = nil;
  4.  
  5. Project1AppDelegate *delegate =
  6. (Project1AppDelegate*)[UIApplication sharedApplication].delegate;
  7.  
  8. if(delegate != nil){
  9. result = [delegate window];
  10. }
  11.  
  12. return result;
  13. }
  14.  
  15. -(void)logMainWindowRect{
  16.  
  17. UIWindow *mainWindow = [self delegateWindow];
  18. if(mainWindow != nil){
  19. NSLog(@"Window Rect = %@",NSStringFromCGRect(MainWindow.frame));
  20. }
  21. }

Report this snippet  

You need to login to post a comment.