Pages

Wednesday, 7 January 2015

How can I detect ,my app is running in the iphone simulator?





Following way we can determine the our App is run in simulator


    NSString *model = [[UIDevice currentDevice] model];
    if ([model isEqualToString:@"iPhone Simulator"])
    {
        
         NSLog(@"device is simulator");
    }



or

NSLog(@"My device is  %@",[[UIDevice currentDevice] model]);

No comments:

Post a Comment