简体   繁体   English

不使用Corona Enterprise调用main.lua

[英]main.lua is not called using Corona Enterprise

I have recently made some significant changes to a Corona Enterprise app I am writing for iOS. 我最近对要为iOS编写的Corona Enterprise应用程序进行了重大更改。 The code was using a .xib file to launch the AppDelegate, and I have removed that and I am loading a different AppDelegate in my main.mm 该代码使用.xib文件启动AppDelegate,并且我删除了该文件,并在main.mm中加载了另一个AppDelegate。

The following is my main.mm 以下是我的main.mm

//
//  main.mm
//  Examples
//

#import <UIKit/UIKit.h>

#import "CoronaApplicationMain.h"
#import "MyAppDelegate.h"


int main(int argc, char *argv[])
{

    @autoreleasepool
    {
        CoronaApplicationMain( argc, argv, [MyAppDelegate class] );
    }
    return 0;
}

This is my MyAppDelegate.h 这是我的MyAppDelegate.h

//
//  MyAppDelegate.h
//


#import <Foundation/Foundation.h>

#import "CoronaDelegate.h"


@interface MyAppDelegate : NSObject< CoronaDelegate >

@end

And finally, this is MyAppDelegate.mm 最后是MyAppDelegate.mm

//
//  MyAppDelegate.mm
//

#import "MyAppDelegate.h"

#import "CoronaRuntime.h"
#import "CoronaLua.h"

@implementation MyAppDelegate

- (void)willLoadMain:(id<CoronaRuntime>)runtime
{
    NSLog ( @"willLoadMain" );
}

- (void)didLoadMain:(id<CoronaRuntime>)runtime
{
    NSLog ( @"didLoadMain" );
}
@end

I am not posting my main.lua as it seem irrelevant. 我没有发布main.lua,因为它似乎无关紧要。 If I am not posting something that is important, then apparently I am assuming that it is not. 如果我没有发布重要的内容,那么显然我以为不是。

When I run the app in xcode iOS simulator, I get a black screen and my willLoadMain and didLoadMain are never called. 当我在xcode iOS模拟器中运行该应用程序时,出现黑屏,并且永不调用我的willLoadMain和didLoadMain。

Please let me know if you see something that I am missing. 如果您看到我想念的东西,请告诉我。

Thanks, Roger 谢谢罗杰

My problem was that somewhere I read that I should remove the .xib files (this was not needed). 我的问题是,我读过某处应该删除.xib文件(不需要)。 Once I re-added them to the project and updated the app-info.plist, everything began working again. 一旦将它们重新添加到项目中并更新了app-info.plist,一切便再次开始工作。 Since I am rather new to Corona Enterprise, Lua and Objective C, I do not understand the details of why this failed and then began working. 由于我是Corona Enterprise,Lua和Objective C的新手,所以我不了解为何失败然后开始工作的详细信息。 At any rate, this issue is now resolved. 无论如何,此问题现在已解决。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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