views:

78

answers:

2

Hi,

I've followed all posts that I've found about creating a Universal App that uses a UISplitViewController and runs fine on iPhone (without it, of course) and in iPad.

My Targeted Device Familiy is => iPhone/iPad iPhone OS Deployment => iPhone OS 3.0 Base SDK => iPhone Device 3.2

My UIKit.framework is 'weak ref' in my Target General

In the place where I use the UISplitViewController *splitViewController; I'm getting the error.

I understand that the iPhone SDK 3.x doesn't have the UISplitViewController but the base of the SDK is 3.2.

Should I use conditionals like this ?

Class splitVCClass = NSClassFromString(@"UISplitViewController");
if (splitVCClass)
{
UISplitViewController* mySplitViewController = [[splitVCClass alloc] init];
// Configure the split view controller.
}

But I'm going to have the same error here as using again the UISplitViewController ...

Thanks !

regards,

m.

general code:

#import <UIKit/UIKit.h>

@class iPad_RootViewController;
@class iPad_DetailViewController;

@interface AppDelegate_Pad : NSObject <UIApplicationDelegate> {

UIWindow *window;

UISplitViewController *splitViewController;

iPad_RootViewController *rootViewController;
iPad_DetailViewController *detailViewController;
}

@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet UISplitViewController *splitViewController;
@property (nonatomic, retain) IBOutlet iPad_RootViewController *rootViewController;
@property (nonatomic, retain) IBOutlet iPad_DetailViewController *detailViewController;

@end

And the error is:

iPad/AppDelegate_Pad.h:18: error: expected specifier-qualifier-list before 'UISplitViewController'

And the UISplitViewController is black, like it hasn't been tokenized

Also I've followed this: Apple iPad Programming Guide

A: 

OK, I see that the problem is only when running in the Simulator, as I'm forced to compile to 3.x and the UISplitViewController isn't in this SDK, so I have to add a bunch of #ifdef around it ...

mongeta
A: 

Apple Documentation says "iPhone OS Deployment => iPhone OS 3.1.3" for universal apps.

and, try like this,

if (splitVCClass) {

id *mySplitViewController = [[splitVCClass alloc] init];

}

GopiKrishnAn