Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/98.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如果扩展WLAppDelegate,MobileFirst我迁移的iOS项目将无响应,但如果扩展WLCordovaAppDelegate,则不会响应_Ios_Migration_Ibm Mobilefirst_Mobilefirst Studio - Fatal编程技术网

如果扩展WLAppDelegate,MobileFirst我迁移的iOS项目将无响应,但如果扩展WLCordovaAppDelegate,则不会响应

如果扩展WLAppDelegate,MobileFirst我迁移的iOS项目将无响应,但如果扩展WLCordovaAppDelegate,则不会响应,ios,migration,ibm-mobilefirst,mobilefirst-studio,Ios,Migration,Ibm Mobilefirst,Mobilefirst Studio,我已经使用MobileFirst Studio将9个iOS混合应用程序从MobileFirst 6.3迁移到MobileFirst 7.1。其中4个应用程序工作正常。但是另外5个,用户界面对点击没有反应。作为自动迁移过程的一部分,这5个应用程序(仅)的标题已更改为引用新的WLAppDelegate接口。奇怪的是,我注意到,如果我将AppName.h文件从扩展WLAppDelegate切换回扩展原始WLCordovaAppDelegate,一切都会正常工作。为什么?我希望将此不推荐的代码转移到新的

我已经使用MobileFirst Studio将9个iOS混合应用程序从MobileFirst 6.3迁移到MobileFirst 7.1。其中4个应用程序工作正常。但是另外5个,用户界面对点击没有反应。作为自动迁移过程的一部分,这5个应用程序(仅)的标题已更改为引用新的WLAppDelegate接口。奇怪的是,我注意到,如果我将AppName.h文件从扩展WLAppDelegate切换回扩展原始WLCordovaAppDelegate,一切都会正常工作。为什么?我希望将此不推荐的代码转移到新的WLAppDelegate接口

当您请求新的iOS应用程序时,我的头文件和.m文件与MobileFirst Studio 7.1生成的默认值匹配,因此它必须是其他文件

这是我的非工作.h和.m文件

//
//  MyAppDelegate.h
//
//

#import <IBMMobileFirstPlatformFoundationHybrid/IBMMobileFirstPlatformFoundationHybrid.h>


@interface MyAppDelegate : WLAppDelegate <WLInitWebFrameworkDelegate> {

}

@end

//
//  MyAppDelegate.m
//  IssuesReturns
//
//
#import "IssuesReturns.h"
#import <IBMMobileFirstPlatformFoundationHybrid/IBMMobileFirstPlatformFoundationHybrid.h>
#import "CDVMainViewController.h"

@implementation MyAppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 
{
    BOOL result = [super application:application didFinishLaunchingWithOptions:launchOptions];

    // A root view controller must be created in application:didFinishLaunchingWithOptions:  
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    UIViewController* rootViewController = [[UIViewController alloc] init];     

    [self.window setRootViewController:rootViewController];
    [self.window makeKeyAndVisible];

    [[WL sharedInstance] showSplashScreen];
    // By default splash screen will be automatically hidden once Worklight JavaScript framework is complete. 
    // To override this behaviour set autoHideSplash property in initOptions.js to false and use WL.App.hideSplashScreen() API.

    [[WL sharedInstance] initializeWebFrameworkWithDelegate:self];

    return result;
}

// This method is called after the WL web framework initialization is complete and web resources are ready to be used.
-(void)wlInitWebFrameworkDidCompleteWithResult:(WLWebFrameworkInitResult *)result
{
    if ([result statusCode] == WLWebFrameworkInitResultSuccess) {
        [self wlInitDidCompleteSuccessfully];
    } else {
        [self wlInitDidFailWithResult:result];
    }
}

-(void)wlInitDidCompleteSuccessfully
{


    UIViewController* rootViewController = self.window.rootViewController;

    // Create a Cordova View Controller
    CDVMainViewController* cordovaViewController = [[CDVMainViewController alloc] init] ;

    cordovaViewController.startPage = [[WL sharedInstance] mainHtmlFilePath];

    // Adjust the Cordova view controller view frame to match its parent view bounds
    cordovaViewController.view.frame = rootViewController.view.bounds;

    // Display the Cordova view
    [rootViewController addChildViewController:cordovaViewController];  
    [rootViewController.view addSubview:cordovaViewController.view];
    [cordovaViewController didMoveToParentViewController:rootViewController];  
}

-(void)wlInitDidFailWithResult:(WLWebFrameworkInitResult *)result
{
    UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"ERROR"
                                                  message:[result message]
                                                  delegate:self
                                                  cancelButtonTitle:@"OK"
                                                  otherButtonTitles:nil];
    [alertView show];
}


- (void)applicationWillResignActive:(UIApplication *)application
{
    // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
    // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}

- (void)applicationDidEnterBackground:(UIApplication *)application
{
    // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 
    // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

- (void)applicationWillEnterForeground:(UIApplication *)application
{
    // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}

- (void)applicationDidBecomeActive:(UIApplication *)application
{
    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

- (void)applicationWillTerminate:(UIApplication *)application
{
    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

@end
//
//MyAppDelegate.h
//
//
#进口
@接口MyAppDelegate:WLAppDelegate{
}
@结束
//
//MyAppDelegate.m
//问题返回
//
//
#导入“IssuesReturns.h”
#进口
#导入“CDVMainViewController.h”
@实现MyAppDelegate
-(BOOL)应用程序:(UIApplication*)应用程序使用选项完成启动:(NSDictionary*)启动选项
{
BOOL result=[超级应用程序:应用程序didFinishLaunchingWithOptions:launchOptions];
//必须在application:didFinishLaunchingWithOptions中创建根视图控制器:
self.window=[[UIWindow alloc]initWithFrame:[[UIScreen mainScreen]bounds]];
UIViewController*rootViewController=[[UIViewController alloc]init];
[self.window setRootViewController:rootViewController];
[self.window makeKeyAndVisible];
[[WL sharedInstance]showSplashScreen];
//默认情况下,一旦Worklight JavaScript框架完成,启动屏幕将自动隐藏。
//要覆盖此行为,请将initOptions.js中的autoHideSplash属性设置为false,并使用WL.App.hideSplashScreen()API。
[[WL sharedInstance]使用委托初始化WebFramework:self];
返回结果;
}
//此方法在WL web框架初始化完成并且web资源准备就绪后调用。
-(void)WLINITWebFrameworkIDCompleteWithResult:(WLWebFrameworkInitResult*)结果
{
如果([result statusCode]==WLWebFrameworkInitResultSuccess){
[self WlinitDidComplete Successfully];
}否则{
[self-wlInitDidFailWithResult:result];
}
}
-(无效)WLINITDIDcomplete成功
{
UIViewController*rootViewController=self.window.rootViewController;
//创建Cordova视图控制器
CDVMainViewController*cordovaViewController=[[CDVMainViewController alloc]init];
cordovaViewController.startPage=[[WL sharedInstance]主HTMLFilePath];
//调整Cordova view controller图幅以匹配其父视图边界
cordovaViewController.view.frame=rootViewController.view.bounds;
//显示Cordova视图
[rootViewController addChildViewController:cordovaViewController];
[rootViewController.view添加子视图:cordovaViewController.view];
[cordovaViewController didMoveToParentViewController:rootViewController];
}
-(void)WLINITDIDFILIWITHRESULT:(WLWebFrameworkInitResult*)结果
{
UIAlertView*alertView=[[UIAlertView alloc]initWithTitle:@“错误”
消息:[结果消息]
代表:赛尔夫
取消按钮:@“确定”
其他按钮:无];
[警报视图显示];
}
-(无效)应用程序将重新签名:(UIApplication*)应用程序
{
//当应用程序即将从活动状态移动到非活动状态时发送。这可能发生在某些类型的临时中断(如来电或短信)或用户退出应用程序并开始转换到后台状态时。
//使用此方法暂停正在进行的任务、禁用计时器和降低OpenGL ES帧速率。游戏应使用此方法暂停游戏。
}
-(无效)应用程序标识符背景:(UIApplication*)应用程序
{
//使用此方法释放共享资源、保存用户数据、使计时器无效,并存储足够的应用程序状态信息,以便在应用程序稍后终止时将其恢复到当前状态。
//如果您的应用程序支持后台执行,则会调用此方法而不是applicationWillTerminate:当用户退出时。
}
-(无效)应用程序将进入前台:(UIApplication*)应用程序
{
//作为从后台转换到活动状态的一部分调用;在这里,您可以撤消在进入后台时所做的许多更改。
}
-(无效)应用IDBECOMEACTIVE:(UIApplication*)应用
{
//重新启动应用程序处于非活动状态时暂停(或尚未启动)的所有任务。如果应用程序以前位于后台,可以选择刷新用户界面。
}
-(无效)申请将终止:(UIApplication*)申请
{
//当应用程序即将终止时调用。如果合适,请保存数据。另请参阅ApplicationIdentinterBackground:。
}
@结束

WLCordovaAppDelegate
是一种不推荐使用的兼容API,允许将v6.2之前的应用程序更轻松地迁移到6.2以上的应用程序。可以使用它,但建议使用
WLAppDelegate

Idan,挂起仅在尝试使用WLAppDelegate时发生。用户界面对点击完全没有反应。如果我切换回WLCordovaAppDelegate,我不会遇到任何问题。有什么想法吗?这是我的.m代码..我打开了一个PMR 51828442000来跟踪这个问题。我没有被阻止,因为我可以继续使用旧的可信的WLCordovaAppDelegate,但是解决它会很好,这样我最终可以向前迁移。