Hello,
I have read the documentation for universal apps and came to the conclusion that the following has to be done in order to get an app run on both iPad and iPhone/iPod touch:
1. I have configurated my iPhone app using Xcodes Upgrade Current Target for iPad.
2. In the AppDelegate, I have seperated the code to be used when running on the different devices as follows in the .h file:
and in the .m file
My problem is:
It seem to work when chosing the iPad simulator 3.2 but if I chose the iPhone simulator 4.0 I get problems. The iPhone simulator is opened up but it tries to open up a view with a popovercontroller and is off course crashing. So - the question is: is this the proper way to seperate code in the appDelegate?
Thanks in advance!
MACloop
I have read the documentation for universal apps and came to the conclusion that the following has to be done in order to get an app run on both iPad and iPhone/iPod touch:
1. I have configurated my iPhone app using Xcodes Upgrade Current Target for iPad.
2. In the AppDelegate, I have seperated the code to be used when running on the different devices as follows in the .h file:
Code:
@interface AppDelegate : NSObject <UIApplicationDelegate, DataAccessDelegate, CLLocationManagerDelegate> {
UIWindow *window;
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 30200
iPadViewController *viewController;
RotatingTabBarController *tabBarController;
#else
UITabBarController *tabBarController;
#endif
and in the .m file
Code:
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 30200
IPADstartViewController *myViewController;
myViewController = [[IPADstartViewController alloc] initWithTabBar];
#else
startViewController *myViewController;
myViewController = [[startViewController alloc] initWithTabBar];
#endif
localNavigationController = [[UINavigationController alloc] initWithRootViewController:myViewController];
[localControllersArray addObject:localNavigationController];// to the array of controllers
[localNavigationController release];// release since we are done with this for now
[myViewController release];
My problem is:
It seem to work when chosing the iPad simulator 3.2 but if I chose the iPhone simulator 4.0 I get problems. The iPhone simulator is opened up but it tries to open up a view with a popovercontroller and is off course crashing. So - the question is: is this the proper way to seperate code in the appDelegate?
Thanks in advance!
MACloop