• home
  • products
  • bosshogg's blog
  • forums
  • about
  • contact us
Home › Blogs › bosshogg's blog

User login

  • Create new account
  • Request new password

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

  • Forums
  • Recent posts
  • Feed aggregator

New forum topics

  • Crash on 10,000 Lite Version 1.6
  • Crash on 1st gen iPhone, looking for iAd framework
  • One thing missing...
  • Hello from my iPad
  • Welcome NetDetective Users!
more

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
more

© Copyright 2009. All rights reserved.

  • home
  • products
  • bosshogg's blog
  • forums
  • about
  • contact us