在哪里可以找到有关在 iPhone 上使用 UISplitViewController 的通用应用程序的信息?

发布于 2024-09-06 14:39:07 字数 1795 浏览 2 评论 0原文

我已经关注了我发现的所有关于创建通用应用程序的帖子,该应用程序使用 UISplitViewController 并在 iPhone(当然没有它)和 iPad 上运行良好。

我的目标设备系列是 => iPhone/iPad iPhone操作系统部署=> iPhone操作系统3.0 基础 SDK => iPhone 设备 3.2

我的 UIKit.framework 在我的目标常规中是“弱引用”

在我使用 UISplitViewController *splitViewController 的地方;我收到错误了。

据我所知,iPhone SDK 3.x 没有 UISplitViewController,但 SDK 的基础是 3.2。

我应该使用这样的条件吗?

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

但我在这里会遇到与再次使用 UISplitViewController 相同的错误...

谢谢!

问候,

m.

通用代码:

#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

错误是:

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

UISplitViewController 是黑色的,就像它没有被标记

一样 我也遵循了这个: Apple iPad 编程指南

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

情场扛把子 2024-09-13 14:39:07

好吧,我发现问题只出现在模拟器中运行时,因为我被迫编译到 3.x 并且 UISplitViewController 不在这个 SDK 中,所以我必须在它周围添加一堆 #ifdef .. 。

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

长梦不多时 2024-09-13 14:39:07

Apple 文档称“iPhone OS 部署 => iPhone OS 3.1.3”适用于通用应用程序。

并且,尝试这样,

如果(splitVCClass){

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

}

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

}

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文