I want to check whether my application is running in iphone or ipod. How can I do this?
Asked
Active
Viewed 1,408 times
2 Answers
1
use below code for finding current device
NSString *deviceStr = [UIDevice currentDevice].model;
NSLog(@"device:%@",deviceStr);
if your device is iPod then it will return
iPod touch
if your device is iPhone
iPhone
if your device is iPad
iPad

Pratik
- 2,399
- 17
- 36
0
Yes,I found out answer for this
#define IS_IPHONE ([[[UIDevice currentDevice] model] isEqualToString:@"iPhone"])
#define IS_IPOD ([[[UIDevice currentDevice] model] isEqualToString:@"iPod touch"])

Sonu
- 665
- 2
- 8
- 20