简体   繁体   中英

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];

Class 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...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM