Detecting iPhone versus iPad

by raulzito234


if([deviceType isEqualToString:@"iPhone Simulator"] || [deviceType isEqualToString:@"iPhone"])

{

NSLog(@"É iPhone seu viado!");

NSLog(@"%@", deviceType);

}

else {

NSLog(@"é iPad seu baitola");

NSLog(@"%@", deviceType);

// Movie explaining what to do!

NSString *stringPath = [[NSBundle mainBundle] pathForResource:@"Scan" ofType:@"MOV"];

NSURL *url = [NSURL fileURLWithPath:stringPath];

mpc = [[MPMoviePlayerController alloc]initWithContentURL:url];

[mpc.view setFrame:CGRectMake(40, 100, 310, 310)];

[mpc setRepeatMode:MPMovieRepeatModeOne];

[mpc setScalingMode:MPMovieScalingModeAspectFill];

[[self view]addSubview:mpc.view];

[mpc prepareToPlay];

[mpc play];

mpc.view.backgroundColor = [UIColor grayColor];

[mpc setControlStyle:MPMovieControlStyleNone];

[self.view addSubview:mpc.view];

}
Advertisements