User login
Detecting the iPhone Simulator
bosshogg — Fri, 11/27/2009 - 19:32
Recently, because of defects with a third party library that we were using for 10,000, I had to figure out if our code was running on the iPhone Simulator and not do a few things. It's not complicated code, but it's not a bad little snippet to keep handy in your programming toolbox. Here is the code I came up with. Please for you to enjoy...
NSString* model= [[UIDevice currentDevice] model];
NSString* simulator = @"iPhone Simulator";
if ([model compare:simulator] == NSOrderedSame)
{
//Simulator!
}
- bosshogg's blog
- Login or register to post comments
Navigation
Recent blog posts
- How the iPad Killed Our iPhone App Sales
- Sending email from within iPhone apps
- iPhone Tie Down Calculator Created for Pacific Cargo Control
- My Opinings On The iPad
- Plug For A Good Small Company
- Gambling Planet Features Three Jacks Games
- Twist Tac Toads Available in the AppStore!
- Getting the Version String
- Your iPhone App Icon
- C++ On The iPhone
