Skip to content

Instantly share code, notes, and snippets.

@eiffelqiu
Created May 27, 2011 00:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eiffelqiu/994426 to your computer and use it in GitHub Desktop.
Save eiffelqiu/994426 to your computer and use it in GitHub Desktop.
Check If Simulator
#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