Created
May 27, 2011 00:43
-
-
Save eiffelqiu/994426 to your computer and use it in GitHub Desktop.
Check If Simulator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define CHECKIFSIMULATOR(MSG) { \ | |
if ([[[UIDevice currentDevice] model] rangeOfString:@"Simulator"].location != NSNotFound) { \ | |
UIAlertView *simError = [[UIAlertView alloc] initWithTitle:@"iOS Simulator" \ | |
message:MSG \ | |
delegate:self \ | |
cancelButtonTitle:@"Okay" \ | |
otherButtonTitles:nil]; \ | |
[simError show]; \ | |
[simError release]; \ | |
} \ | |
} | |
// Usage: CHECKIFSIMULATOR(@"This feature not available in the iOS Simulator."); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment