iPhone/iPad universal app will not build for iPhone
I have made my application universal for iPhone and iPad (window-based application; universal) from scratch. First I made all logic and views for iPhone and it worked. After that I created views for iPad. That worked to. But when I implemented UISplitViewController or UIPopover, the application will not build anymore for iPhone.
I call my custom splitViewController like that:
MySplitViewController *mySplitViewController = [[MySplitViewController" alloc] init];
Clas开发者_运维问答s definition looks like that: @interface MySplitViewController : UISplitViewController { }
On build (for iPhone 3.1.3) it gives me this error:
cannot find interface declaration for 'UISplitViewController', superclass of 'MySplitViewController'
Afcourse, SDK 3.1.3 does not contain all new features from SDK 3.2. That's clear. So I tried creating instance of my class like that:
MySplitViewController *mySplitViewController = [[NSClassFromString(@"MySplitViewController") alloc] init];
It still gives me the same error.
I also tried to weak-link framework but that helped neither.
What I also tried is that I wrap creating instance of class in parentheses like that:
Class cls = NSClassFromString(@"UIPopoverController");
if (cls != nil) {
MySplitViewController *mySplitViewController = [[NSClassFromString(@"MySplitViewController") alloc] init];
}
Could please someone tells me how can I call specific classes so I can run my application for both platform ?
Thanks
I have found the solution here.
I hope it will helps someone else...
精彩评论