Specifying Simulator Only Code 
Specifying Simulator Only Code

There are times when you need to write code that is only applicable when working with the simulator. To give the compiler a heads up as to which code block to include, use a compiler directive as shown below:

#if TARGET_IPHONE_SIMULATOR
NSLog(@"Running on Simulator");
#else
NSLog(@"Running on Device");
#endif


No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

You must be logged in to post a comment.

---