iphone通用应用程序中未调用主AppDelegate
我正在从事xcode项目,旨在制作一个通用应用程序。使用基于窗口的应用程序模板,我得到了3个AppDelegate方法。ipad和iphone各2个,主AppDelegate方法1个。当我为ipad运行时,会调用主AppDelegate方法,但当我为iphone环境运行时,主AppDelegate未被调用。因此,如何在Iphone环境下运行控制器时将其设置为主AppDelegate方法 下面是描述。。 我有3种appdelegate方法,即prjOUMAppDelegate(主appdelegate)、prjOUMAppDelegate_iPhone(用于iPhone)、prjOUMAppDelegate_iPad(用于iPad)。。iphone通用应用程序中未调用主AppDelegate,iphone,objective-c,xcode,ipad,ios-universal-app,Iphone,Objective C,Xcode,Ipad,Ios Universal App,我正在从事xcode项目,旨在制作一个通用应用程序。使用基于窗口的应用程序模板,我得到了3个AppDelegate方法。ipad和iphone各2个,主AppDelegate方法1个。当我为ipad运行时,会调用主AppDelegate方法,但当我为iphone环境运行时,主AppDelegate未被调用。因此,如何在Iphone环境下运行控制器时将其设置为主AppDelegate方法 下面是描述。。 我有3种appdelegate方法,即prjOUMAppDelegate(主appdelega
我有一些常用的方法,比如创建文件夹和移动用PRJOUMAPDelegate(主appdelegate)方法编写的文件。我希望它每次都运行,而不考虑设备,这样我就可以创建文件夹和移动一些文件。在ipad上运行它(即创建文件夹和移动文件)时工作正常但是,当我将环境更改为iphone时,没有调用prjOUMAppDelegate(主appdelegate)方法。因此,我不知道我哪里出错了。好的,你的问题确实令人困惑。我想你在找这样的东西
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
self.viewController = //Initialize the ViewController for iPhone environment
}
else {
self.viewController = //Initialize the ViewController for iPad environment
}
self.navigationController = [[UINavigationController alloc]
initWithRootViewController:self.viewController];
[self.window addSubview:self.navigationController.view];
[self.window makeKeyAndVisible];
return YES;
}
如果这不是您要寻找的答案,请用一些代码更新您的问题。我认为您需要用代码进行更多的解释,因为这确实令人困惑。@ParthBhatt:请看我编辑的问题多个AppDelegate并不常见,因为几乎没有理由这样做。因此,如果不发布一些代码,恐怕您不会得到太多帮助。@ade:我没有创建2个appDelegate方法,我们在创建通用应用时默认会得到它。您使用的sdk是什么?当我创建一个空的应用程序时(我想以前称为基于窗口的应用程序),我只得到一个应用程序委托。