Posted By

oppey on 05/11/11


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

Tintenklecks


iPhone iPad


 / Published in: Objective C
 

  1. -�void� viewDidLoad {
  2.  
  3.  
  4. #if (__IPHONE_OS_VERSION_MAX_ALLOWED >= 30200)
  5.  
  6. NSString *str;
  7.  
  8. if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
  9. str = [NSString stringWithString:@"Running as an iPad application"];
  10. } else {
  11. str = [NSString stringWithString:
  12. @"Running as an iPhone/iPod touch application"];
  13. }
  14.  
  15. UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Platform"
  16. message:str
  17. delegate:nil
  18. cancelButtonTitle:@"OK"
  19. otherButtonTitles:nil];
  20. [alert show];
  21. [alert release];
  22.  
  23. #endif
  24.  
  25. [super viewDidLoad];
  26. }

Report this snippet  

You need to login to post a comment.