Guest User

Untitled

a guest
Jan 18th, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. #import <sys/utsname.h>
  2.  
  3. NSString*
  4. machineName()
  5. {
  6. struct utsname systemInfo;
  7. uname(&systemInfo);
  8.  
  9. return [NSString stringWithCString:systemInfo.machine
  10. encoding:NSUTF8StringEncoding];
  11. }
  12.  
  13. @"i386" on the simulator
  14. @"iPod1,1" on iPod Touch
  15. @"iPod2,1" on iPod Touch Second Generation
  16. @"iPod3,1" on iPod Touch Third Generation
  17. @"iPod4,1" on iPod Touch Fourth Generation
  18. @"iPhone1,1" on iPhone
  19. @"iPhone1,2" on iPhone 3G
  20. @"iPhone2,1" on iPhone 3GS
  21. @"iPad1,1" on iPad
  22. @"iPad2,1" on iPad 2
  23. @"iPhone3,1" on iPhone 4
  24. @"iPhone4,1" on iPhone 4S
  25.  
  26. NSString *iphoneType = machineName();
  27. if ([iphoneType isEqualToString@"iPhone5,1"]){
  28. //image for iphone 5
  29. } else {
  30. //image for the rest
  31. }
Add Comment
Please, Sign In to add comment