If you really need a simple source that compiles as a universal application that writes Hello World to the console, depending on the device you are using, here you will find a tiny snippet.
main.m
#import <UIKit/UIKit.h> int main(int argc, char *argv[]) { if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { printf("hello world, from my iPad"); } else { printf("hello world, from my iPhone or iPod"); } return 0; }
In the build settings of your application, you will need to choose:
TARGETED_DEVICE_FAMILY = 1,2
Like this: 
source share