在哪里可以找到有关在 iPhone 上使用 UISplitViewController 的通用应用程序的信息?
我已经关注了我发现的所有关于创建通用应用程序的帖子,该应用程序使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好吧,我发现问题只出现在模拟器中运行时,因为我被迫编译到 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 ...
Apple 文档称“iPhone OS 部署 => iPhone OS 3.1.3”适用于通用应用程序。
并且,尝试这样,
Apple Documentation says "iPhone OS Deployment => iPhone OS 3.1.3" for universal apps.
and, try like this,