Phonegap Xcode 6.1 nsexception [英] Phonegap Xcode 6.1 nsexception

查看:107
本文介绍了Phonegap Xcode 6.1 nsexception的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我厌倦了无处不在寻找和回答。我是新的phonegap,我刚刚做的是创建一个默认项目,构建它,然后打开Xcode为了模拟它。



它运行良好,但过一会儿会抛出一个错误(或者异常不知道它是如何调用的),它所做的只是显示图像,而不是文本



以下是错误:

  2014-12 -12 20:34:39.339 Hello World [4441:609951] DiskCookieStorage将策略从2更改为0,cookie文件:file:///用户/ pas /资料库/ Developer / CoreSimulator / Devices / 50XXXXX-BEA1-447C-A70E- 98XXXXXXXXA / data / Containers / Data / Application / DFXXXXX-E46C-430D-9B57-9XXXXXXX441 / Library / Cookies / Cookies.binarycookies 
2014-12-12 20:34:39.606 Hello World [4441:609951] ** *由于未捕获异常NSUnknownKeyException而终止应用程序,原因:'[< UIApplication 0x7ae1a170> setValue:forUndefinedKey:]:这个类不是键值编码的关键视图。'
***第一次调用堆栈:

0 CoreFoundation 0x002ea946 __exceptionPreprocess + 182
1 libobjc.A.dylib 0x0243aa97 objc_exception_throw + 44
2 CoreFoundation 0x002ea561 - [NSException raise] + 17
3基础0x020c210e - [NSObject(NSKeyValueCoding)setValue:forUndefinedKey:] + 282
4基金会0x0201e138 _NSSetUsingKeyValueSetter + 115
5基金会0x0201e0bd - [NSObject的(即NSKeyValueCoding)的setValue:forKey:] + 267
6基金会0x020539a6 - [NSObject的(即NSKeyValueCoding)的setValue:forKeyPath:] + 386
7 UIKit 0x009d3649 - [UIRuntimeOutletConnection connect] + 106
8 libobjc.A.dylib 0x02450724 - [NSObject performSelector:] + 62
9 CoreFoundation 0x002245dc - [NSArray makeObjectsPerformSelector:] + 316
10 UIKit 0x009d210a - [UINib instantiateWithOwner:选项:] + 1775
11的UIKit 0x009d3fa9 - [一个NSBundle(UINSBundleAdditions)loadNibNamed:老板:选项:] + 180
12的UIKit 0x0069ce1b - [UIApplication的_loadMainNibFileNamed:捆绑:] + 58
13的UIKit 0x0069d134 - [UIApplication的_loadMainInterfaceFile] + 245
14的UIKit 0x0069badf - [UIApplication的_runWithMainScene:transitionContext:完成:] + 1337
15的UIKit 0x006b47d0 __84- [UIApplication的_handleApplicationActivationWithScene:transitionContext:完成: ] _block_invoke + 59
16的UIKit 0x0069a81f - [UIApplication的workspaceDidEndTransaction:] + 155
17 FrontBoardServices 0x02fba9de __37- [FBSWorkspace clientEndTransaction:] _ block_invoke_2 + 71
18 FrontBoardServices 0x02fba46f __40- [FBSWorkspace _performDelegateCallOut:] _block_invoke + 54
19 FrontBoardServices 0x02fcc425 __31- [FBSSerialQueue performAsync:] _ block_invoke + 26
20的CoreFoundation 0x0020e1c0 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 16
21的CoreFoundation 0x00203ad3 __CFRunLoopDoBlocks + 195
22的CoreFoundation 0x0020392b __CFRunLoopRun + 2715
23的CoreFoundation 0x00202bcb CFRunLoopRunSpecific + 443
24的CoreFoundation 0x002029fb CFRunLoopRunInMode + 123
25的UIKit 0x0069a1e4 - [UIApplication的_run] + 571
26的UIKit 0x0069d8b6 UIApplicationMain + 1526
27你好世界0x000dbfec main + 92
28 libdyld.dylib 0x02b1aac9 start + 1

libc ++ abi.dylib:以NSException类型的未捕获异常终止



这里是错误来源的代码片段:

  #import< UIKit / UIKit.h> 
int main(int argc,char * argv [])
{
@autoreleasepool {
int retVal = UIApplicationMain(argc,argv,nil,@AppDelegate);
return retVal;
}
}

我会感谢任何种类的帮助我疯了。
谨慎



PS:我可能只能通过缩进4个空格来包含代码,我必须对每一行执行此操作,这是不切实际的

解决方案

我有同样的问题。问题的原因是常规设置中的主界面字段。此字段应为空。不要选择 MainViewController ,否则将抛出此错误。



这里是我的错误示​​例:


I am tired of looking everywhere to find and answer. I'm new to phonegap and what I just did was creating a default project, building it and then opening with Xcode in order to emulate it.

It runs well, but after a moment throws an error (or exception don't know how it's called) and what it does is just showing the image but not the text and else.

Here is the error:

2014-12-12 20:34:39.339 Hello World[4441:609951] DiskCookieStorage changing policy from 2 to 0, cookie file: file:///Users/pas/Library/Developer/CoreSimulator/Devices/50XXXXX-BEA1-447C-A70E-98XXXXXXXXA/data/Containers/Data/Application/DFXXXXX-E46C-430D-9B57-9XXXXXXX441/Library/Cookies/Cookies.binarycookies
2014-12-12 20:34:39.606 Hello World[4441:609951] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIApplication 0x7ae1a170> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key view.'
*** First throw call stack:
(
    0   CoreFoundation                      0x002ea946 __exceptionPreprocess + 182
    1   libobjc.A.dylib                     0x0243aa97 objc_exception_throw + 44
    2   CoreFoundation                      0x002ea561 -[NSException raise] + 17
    3   Foundation                          0x020c210e -[NSObject(NSKeyValueCoding)      setValue:forUndefinedKey:] + 282
    4   Foundation                          0x0201e138 _NSSetUsingKeyValueSetter + 115
    5   Foundation                          0x0201e0bd -[NSObject(NSKeyValueCoding) setValue:forKey:] + 267
    6   Foundation                          0x020539a6 -[NSObject(NSKeyValueCoding) setValue:forKeyPath:] + 386
    7   UIKit                               0x009d3649 -[UIRuntimeOutletConnection connect] + 106
    8   libobjc.A.dylib                     0x02450724 -[NSObject performSelector:] + 62
    9   CoreFoundation                      0x002245dc -[NSArray makeObjectsPerformSelector:] + 316
    10  UIKit                               0x009d210a -[UINib instantiateWithOwner:options:] + 1775
    11  UIKit                               0x009d3fa9 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 180
    12  UIKit                               0x0069ce1b -[UIApplication _loadMainNibFileNamed:bundle:] + 58
    13  UIKit                               0x0069d134 -[UIApplication _loadMainInterfaceFile] + 245
    14  UIKit                               0x0069badf -[UIApplication _runWithMainScene:transitionContext:completion:] + 1337
    15  UIKit                               0x006b47d0 __84-[UIApplication _handleApplicationActivationWithScene:transitionContext:completion:]_block_invoke + 59
    16  UIKit                               0x0069a81f -[UIApplication workspaceDidEndTransaction:] + 155
    17  FrontBoardServices                  0x02fba9de __37-[FBSWorkspace clientEndTransaction:]_block_invoke_2 + 71
    18  FrontBoardServices                  0x02fba46f __40-[FBSWorkspace _performDelegateCallOut:]_block_invoke + 54
    19  FrontBoardServices                  0x02fcc425 __31-[FBSSerialQueue performAsync:]_block_invoke + 26
    20  CoreFoundation                      0x0020e1c0 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 16
    21  CoreFoundation                      0x00203ad3 __CFRunLoopDoBlocks + 195
    22  CoreFoundation                      0x0020392b __CFRunLoopRun + 2715
    23  CoreFoundation                      0x00202bcb CFRunLoopRunSpecific + 443
    24  CoreFoundation                      0x002029fb CFRunLoopRunInMode + 123
    25  UIKit                               0x0069a1e4 -[UIApplication _run] + 571
    26  UIKit                               0x0069d8b6 UIApplicationMain + 1526
    27  Hello World                         0x000dbfec main + 92
    28  libdyld.dylib                       0x02b1aac9 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

And here is the piece of code from where the error comes:

#import <UIKit/UIKit.h>
int main(int argc, char* argv[])
{
    @autoreleasepool {
        int retVal = UIApplicationMain(argc, argv, nil, @"AppDelegate");
        return retVal;
    }
}

I'd appreciate any kind of help this is driving me mad. Regards

PS: how is it possible that I can only include code by indenting with 4 spaces I had to do this for every line, that is so impractical

解决方案

I had the same exact issue. The cause of the problem is the Main Interface field in your General Settings. This field should be blank. Do not select MainViewController, otherwise this error will be thrown.

Here is my example of the error:

这篇关于Phonegap Xcode 6.1 nsexception的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆