Tuesday, April 16, 2013

Determine device (iPhone,iPad , iPod Touch) with iPhone SDK


if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
        {
            NSLog(@"I'm iPad");
    } else {
    NSString *deviceType = [UIDevice currentDevice].model;
                if([deviceType rangeOfString:@"iPhone"].location!=NSNotFound)
                {
                    NSLog(@"I m iPhone");

                } else {
                    NSLog(@" I'm  iPod");

                }
}

No comments:

Post a Comment